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

[单项选择]下列程序执行之后,将输出 public class exl9 { public static void main(string[] args) { int x=3; int y=7; switch(y/x){ case 1: y*=2; break; case 2: y*=3; break; case 3: y*=4; break; default: y=0; } System.out.print(y); } }
A. 28
B. 21
C. 14
D. 0

更多"下列程序执行之后,将输出 public class exl9 "的相关试题:

[单项选择]执行下面程序段,屏幕上将输出( )。
public class Test
private int x=10,y=20;
public Test (int x,int y)
System.out.println (x+this.x);
System.out.println (y+y);
public static void main (String[] args)
Testt= new Test(30,50);

A. 无输出
B. 20
C. 40
D. 40
[单项选择]执行下面程序段,屏幕上将输出( )。 public class Test { private int x=10,y=20; public Test (int x,int y) { System.out.println (x+this.x); System.out.println (y+y); } public static void main (String[] args) { Testt= new Test(30,50); } }
A. 无输出
B. 20 40
C. 40 100
D. 40 70
[单项选择]下列程序执行之后,输出的结果是______。 public class exl0 { public static void main(String[] args) { int j=0; a1: for (int i=3;i>0; i--) { j+=i; a2: for (int k=l; k<3; k++) { j*=k; if(i==k) break a1; } } System.out.println(j); } }
A. 18
B. 16
C. 14
D. 0
[单项选择]下列程序执行之后,输出的结果是______。 public class ex4 { public static void main(String[] args) { int j=0; for(int i=3;i>0;i--) { j+=i; int x=2; while(x<j) { x+=1; System.out,print(x); } } } }
A. 3555
B. 35556666
C. 33453456
D. 345
[单项选择]执行如下程序:
public class Test
public static void main (String args[])
int x=1,a=0,b=0;
switch (x)
case 0: b++;
case 1: a++;
case 2: a++;b++;

System.out.println("a=" +a ",b=" +b);


该程序的输出结果是( )。
A. a=2,b=1
B. a=1,b=1
C. a=1,b=0
D. a=2,b=2
[单项选择]下列程序执行后,j的值是  public class Testggg     public static void main(String args[ ])         int j=1;     for(int i=7;i>0;i-=2)      j * =2;     System.out.println(j);
A. 15
B. 1
C. 32
D. 16
[单项选择]执行下列程序段之后,变量b的值为( )。
public class Test
public static void main (String[] args)
int i = 12;
int j = 24;
boolean b1 = true;
booleanb=(j%i==0)&&(! b1) || (j/i! =2);
System. out. println (b);


A. true
B. false
C. 0
D. 1
[单项选择]下列程序执行后,m的值是  public class Testbbb    public static void main (String args[ ])     int a=10,b=3,m=5;    if(a= =B) m + =a;    else m:+ +a*m;    System.out.println(m);
A. 15
B. 50
C. 55
D. 5
[单项选择]下列程序执行后,k的值是  public class Testddd  public static void main(String args[ ])      inti;10,j=18 K=30;    switch(j-i)     case 8:k++;     case 9:k+ =2;     case 10:k+ =3;     default:k/=j;       System.out.println(k);
A. 31
B. 32
C. 2
D. 33
[单项选择]下列程序的执行结果是  public class Testhh    public static void main(String args [] )     Strings1=new String("I am boy");    Strings2=new String("I am boy");     System.out.println(s1.equals(s2));     
A) true
B) falseC) I am boy D) 都不正确

[单项选择]执行下列程序段之后,变量b的值为( )。 public class Test { public static void main (String[] args) { int i = 12; int j = 24; boolean b1 = true; booleanb=(j%i==0)&&(! b1) || (j/i! =2); System. out. println (b); } }
A. true
B. false
C. 0
D. 1
[单项选择]执行下列程序之后,变量n的值为( )。
public class Test
publie static void main (String[] args)
int y=2;
int z=3;
int n=4;
n=n+ -y * z/n;
System. out. println (n);


A. 3
B. -1
C. -12
D. -3
[单项选择]下列程序的执行结果是 ( )
public class Test

public int aMethod( )

satic int i=0;
i++;
System.out.println(i);

public static void.main(String args[])

Test test=new Test( );
test.aMethod( );

A. 编译错误
B. 0
C. 1
D. 运行成功,但不输出
[单项选择]执行下面程序后,结果是   public class Testrr      public static void main(String args[])      int i=0xFFFFFFF1;      int j=-i;      System.out.println("j="+j);       A) j=-15 B) j=-16C) j=16
D) j=15

[单项选择]下面程序执行后,输出的结果是( )。
public class Test
public static void main (String[] )args)
boolean m=true;
if(m==false) System.out.println("假");
else
if(m====true) System.out.println("真");
else System.out.println ("错误");


A. 真
B. 假
C. 错误
D. 编译出错
[单项选择]下列程序执行后,j的值是( )。
public class Test

public static void main(String args[])

int j=1;
for(int i=7; i>0; i-=2)
j*=2;
System.out.println(j);


A. 15
B. 1
C. 32
D. 16
[单项选择]下列程序执行后,屏幕上显示的应是
public class Testyyy
public static void main(String[]args)
char charl[]=,’t’ ’e’’s],’t’;
char char2[]=’t’,’e’,’s’,’t’,’1’;
String s1=new String(char1);
String s2=new String(char2,0,4);
System.out.println(s1.equals(s2));


A. true
B. false
C. test
D. 编译错误

我来回答:

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

订单号:

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