题目内容 (请给出正确答案)
[主观题]

【单选题】执行下列代码段之后,输出结果为()。 public class H{ public static void main(String[]

【单选题】执行下列代码段之后,输出结果为()。 public class H{ public static void main(String[] args){ int sum=2,a=3,b=5,c=7; while (a<b){ while (b!="c){" sum+="b;" b++; } b="5;" a++; system.out.println(sum);> A、23

B、24

C、25

D、26

暂无答案
如搜索结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能会需要:
您的账号:
发送账号密码至手机
发送
更多“【单选题】执行下列代码段之后,输出结果为()。 public…”相关的问题

第1题

下列语句输出结果为( )。 public class test { public static void main (String args[ ]) { int m=20,n=10; System.out.println((- -m)*(n+ +)); } }

A.200

B.190

C.209

D.220

点击查看答案

第2题

下列程序段的输出结果为【 】。 public class Test { void printValue(int m) { do { Systern.out,println("The value is "+m); } while(-m>10); } public static void main(String arg[]){ int i=10; Test t=new Test(); t.print Value(i); } }

点击查看答案

第3题

下列程序的输出结果是( )。 public class Test { public static void main (String[] args) { String s="hello"; s.replace ('r','m'); System.out.println(s); } }

A.hello

B.HELLO

C.hemmo

D.HEMMO

点击查看答案

第4题

下列程序运行后的输出结果是( )。 public class Sun { public static void main(String args[ ]) { int a,b; a=0; b=0; for(int m=1;m<=10;m++) { a=a+1; b=0; for(int j=1;j<=10;j++) { a=a+1; b=b+2; } } System.out.println(a+","+B) ; } }

A.10,20

B.20110

C.110,20

D.200110

点击查看答案

第5题

下列代码的编译或执行结果是( )。 public class Myval{ public static void main(string args[]){ MyVal m=new MyVal; aMethod; } public void aMethod{ boolean b[]=new Boolean[5]; System.OUt.println(b[0]); } }

A.1

B.null

C.0

D.编译错误

点击查看答案

第6题

下面代码的执行结果是( )。 public class test { public static void main (String args[]) { float m=5.0f; int n=4; System.out.println((++m)*(n--)); } }

A.20.0

B.20

C.24.0

D.24

点击查看答案

第7题

下列程序运行后的输出结果是( )。 public class Sun { public static void main(String args[]) { int a,b; a=0; b=0; for(int m=1;m<=10;m++) { a=a+1; b=0; for(int j=1;j<=10;j++) { a=a+1; b=b+2; } } System.out.println(a+","+b); } }

A.10,20

B.20110

C.110,20

D.200110

点击查看答案

第8题

下面程序执行后,输出的结果是( )。 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.编译出错

点击查看答案

第9题

给出下面代码段:

public class Test{

public static void main(String args[])

{

int m;

switch(m)

{

case 0 :System.out.println("case 0");

case 1 :System.out.println("case 1");

break;

case 2 :break;

default :System.out.println("default");

}

}

}

下列m的值能引起输出“default”的是( )。

A.0

B.1

C.2

D.4

点击查看答案

第10题

给出下面代码段: public class Test{ public static void main(String args[] ) { int m; switch(m) { case 0: System.out.println("case 0"); case 1: System.out.println("case 1"); break; case 2: break; default: System.out.println("default"); } } } 下列m的值能引起输出“default”的是( )。

A.0

B.1

C.2

D.4

点击查看答案
热门考试 全部 >
相关试卷 全部 >
账号:
你好,尊敬的上学吧用户
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改
谢谢您的反馈

您认为本题答案有误,我们将认真、仔细核查,
如果您知道正确答案,欢迎您来纠错

警告:系统检测到您的账号存在安全风险

为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!

微信搜一搜
上学吧
点击打开微信
警告:系统检测到您的账号存在安全风险
抱歉,您的账号因涉嫌违反上学吧购买须知被冻结。您可在“上学吧”微信公众号中的“官网服务”-“账号解封申请”申请解封,或联系客服
微信搜一搜
上学吧
点击打开微信