题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-10-01 01:02:53

[单项选择]阅读下面程序 public class Test2 {  public static void main(String[] args) {   int a=10,b=4.c=20,d=6;    System.out.println(a++*b+c*--d);  } } 程序运行的结果是
A. 144
B. 160
C. 140
D. 164

更多"阅读下面程序 public class Test2 {  publ"的相关试题:

[单项选择]阅读下面程序 public class Test4 {  public static void main(String[] args) {   int 1=10,j=3;   float m=213.5f,n=4.0f;   System.out.println(i%j);   System.out.println(m%n);  } } 程序运行的结果是
A. 1.0和1.5
B. 1和1.5
C. 1.0和2.5
D. 1和2.5
[单项选择]阅读下面程序 public class Test3 {  public static void main(String[] args) {   int x=3,y=4,z=5;   String s="xyz":   System.out.println(s+x+y+z);  } } 程序运行的结果是
A. xyz12
B. xyz345
C. xyzxyz
D. 12xyz
[单项选择]阅读下面程序 public class Test1 { public static void main(String[] args) {  System.out.println(34+56-6);  System.out.println(26*2-3);  System.out.println(3*4/2);  System.out.println(5/2);  } } 程序运行的结果是
A. 84 49 6 2
B. 90 25 6 2.5
C. 84 23 12 2
D. 68 49 14 2.5
[单项选择]下列程序的功能为( )。public class Test2{public static void main(Stringargs[]){int i,s=0;for(i=1;i<10;i+=2)s+=i+1;System.out. pnntln(s);}}
A. 计算自然数1~9的累加和
B. 计算自然数1~10的累加和
C. 计算自然数1~9中的奇数之和
D. 计算自然数1~10中的偶数之和
[单项选择]

阅读下面程序
pubic class Cycle{
public static void main(String args[]){
System. out. println(args[0]);
在命令行中输入java Cycle one two,该程序输出结果是()


A. Cycle
B. one
C. two
D. 上述A、B、C、均不对
[单项选择]阅读下列程序: public class Test { public static void main (String args[]) { int x=3; for (int i=1;i<=10; i++) x=x+i/4; System. out. println(x);} }程序的输出结果是( )。
A. 12
B. 13
C. 14
D. 15
[单项选择]阅读下面程序 public class ConcatTest {  public static void main(String[] args) {   String str1="abc";   String str2="ABC":   String str3=str1.concat(str2);   System.out.println(str3);  } } 程序运行的结果是
A. abc
B. ABC
C. abcABC
D. ABCabc
[单项选择]有下列程序段 public class fun { public static void main(String args[]) { char b[]="Hello,you"; b[5] = 0; System.out.println(s); } 执行此程序后,得到的输出结果是( )。
A. Hello, you
B. Hello0you
C. Hello
D. 0
[单项选择]有如下程序: public class Sun { public static void main(String args[ ]) { int s=0; int i=1; while (i<=100) { s=s+i; } System.out.println(s); } } 运行后的结果是( )。
A. 5050
B. 5051
C. 死循环,直到溢出
D. 无穷大的数
[单项选择]阅读下列代码: public class Test{ public static void main(String args[]{ System.out.println(100%3); System.out.pnntln(100%3.0); } } 程序运行结果为( )。
A. 1和1
B. 1和1.0
C. 1.0各1
D. 1.0和1.0
[单项选择]有如下程序: public class Sun { public static void main(String args[ ]) { int s=0; int i=1; while(i<=100) { s=s+i; } System.out.println(s); } } 运行后的结果是( )。
A. 5050
B. 5051
C. 死循环,直到溢出
D. 无穷大的数
[单项选择]有下列程序段 public class fun { public static void main(String args[]) { char b[] = "Hello,you"; b[5] = 0; System.out.println(s); } 执行此程序后,得到的输出结果是( )。
A. Hello,you
B. Hello0you
C. Hello
D. 0
[单项选择]

阅读下列代码
public class Test{
public static void main(String args[]){
System. out. println((2<0) 10:8);
}
}
其运行结果是()


A. 2
B. 0
C. 10
D. 8
[单项选择]public class Test{ public static void main(String args[]){ int a=2,b=4,c=6 Strint s="abc"; System.out.print (a/b+s+c); } }
A. "absac"
B. "242466"
C. "6abc6"
D. "24abc6"
[单项选择]以下程序输出结果为( )。 class test 2 { public static void main(String args[]) { int n = 7; n<<=3; n=n&n+1|1n+2^n+3; n>>=2; System.out.println(n); } }
A. 0
B. -1
C. 14
D. 64
[单项选择]以下程序输出结果为( )。 class test 2 { public static void main(String args[]) { int n=7; n<<=3; n=n&n+1 |n+2^n+3; n>>=2; System.out.println(n); } }
A. 0
B. -1
C. 14
D. 64
[单项选择] public class Pass{ public static void main(String[]args){ int x=5; Pass p=new Pass(); p.doStuff(x); System.out.print("mainx="+x); } void doStuff(intx){ System.out.print("doStuffx="+x++); } } What is the result?()
A. Compilation fails.
B. An exception is thrown at runtime.
C. doStuff x=6 main x=6
D. doStuff x=5 main x=5
E. doStuff x=5 main x=6
F. doStuff x=6 main x=5
[单项选择] public class Test{ public static void main(String[]args){ intx=5; boolean b1=true; boolean b2=false; if((x==4)&&!b2) System.out.print("l"); System.out.print("2"); if((b2=true)&&b1) System.out.print("3"); } } What is the result?()
A. 2
B. 3
C. 12
D. 23
E. 123
F. Compilation fails.
G. An exceptional ist hrown at runtime.

我来回答:

购买搜题卡查看答案
[会员特权] 开通VIP, 查看 全部题目答案
[会员特权] 享免全部广告特权
推荐91天
¥36.8
¥80元
31天
¥20.8
¥40元
365天
¥88.8
¥188元
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《购买须知》
立即支付 系统将自动为您注册账号
请使用微信扫码支付

订单号:

请不要关闭本页面,支付完成后请点击【支付完成】按钮
恭喜您,购买搜题卡成功
重要提示:请拍照或截图保存账号密码!
我要搜题网官网:https://www.woyaosouti.com
我已记住账号密码