云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > java程序设计答案

java程序设计答案

  • 62 次阅读
  • 3 次下载
  • 2026/4/26 21:44:34

2、下列代码的执行结果为: public class Test {

public static void main(String[] args) { String s1=new String(\

String s2=new String(\System.out.println(s1==s2);

System.out.println(s1.equals(s2)); } }

3、给出下列程序的输出结果:

public class ex23{

public static void main(String[ ]args){ float x=5; float y=5; double c=10; c%=(++x)*y;

System.out.println(x); System.out.println(c);

} }

4、下列代码的执行结果为: public class ex23{

public static void main(String[ ]args){ int x=12; int m=11; int y=13;

int temp=x>y?x:y;

System.out.println(temp);

temp=temp>m?temp:m; System.out.println(temp); } }

5、public class test1{

public static void main(String[]args) {

for(int cnt=0;cnt<10;cnt++) {

if (cnt==5) break;

System.out.print(cnt); } } }

四、编程题 1、编写程序,求

?kk?1102的值。.

2、编写打印下列图形的程序。

%

% % % % % % % % % 3、有一函数:

x (x<1) y = 3x-2 (1≤x<10) 4x (x≥10)

编写一程序,x值通过键盘输入,输出y值。

4、编写打印下列图形的程序:(10分)

* * * * * * * * * * * * * * * *

5、编写一程序,查找某一字符串是否包含有 “abc”。 6、3、考虑一个2×3的数组a。(20分)

(1) 为a写一个声明。试问,这样的声明使a有多少行,多少列,多少元素? (2) 写出a 的第1行的所有元素的名字。 (3) 写一条语句,置行1列2的元素为零。

(4) 写一个嵌套for结构,将a 的每个元素初始化为零。 (5) 写一条语句,求第3列元素的和。

7、编写程序,打印三角形状的九九乘法表,要求使用break或continue语句。(20分)

搜索更多关于: java程序设计答案 的文档
  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

2、下列代码的执行结果为: public class Test { public static void main(String[] args) { String s1=new String(\String s2=new String(\System.out.println(s1==s2); System.out.println(s1.equals(s2)); } } 3、给出下列程序的输出结果: public class ex23{ public static void main(String[ ]args){ float x=5; float y=5; double c=10; c%=(++x)*y; <

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com