题目内容 (请给出正确答案)
[单选题]

阅读下面的程序,程序的运行结果是()。classStringDemo{publicstaticvoidmain(String[]args){Strings1=“a”;Strings2=“b”;show(s1,s2);System、out、println(s1+s2);}publicstaticvoidshow(Strings1,Strings2){s1=s1+”q”;s2=s2+s1;}}

A.ab

B.aqb

C.aqbaq

D.aqaqb

提问人:网友18***192 发布时间:2022-01-07
参考答案
查看官方参考答案
如搜索结果不匹配,请 联系老师 获取答案
网友答案
查看全部
  • · 有5位网友选择 A,占比16.67%
  • · 有4位网友选择 C,占比13.33%
  • · 有4位网友选择 C,占比13.33%
  • · 有3位网友选择 B,占比10%
  • · 有3位网友选择 B,占比10%
  • · 有2位网友选择 A,占比6.67%
  • · 有2位网友选择 A,占比6.67%
  • · 有2位网友选择 D,占比6.67%
  • · 有2位网友选择 C,占比6.67%
  • · 有2位网友选择 B,占比6.67%
  • · 有1位网友选择 D,占比3.33%
匿名网友 选择了A
[113.***.***.135] 1天前
匿名网友 选择了D
[65.***.***.83] 1天前
匿名网友 选择了A
[176.***.***.120] 1天前
匿名网友 选择了A
[219.***.***.20] 1天前
匿名网友 选择了D
[37.***.***.179] 1天前
匿名网友 选择了C
[170.***.***.64] 1天前
匿名网友 选择了B
[244.***.***.214] 1天前
匿名网友 选择了A
[63.***.***.28] 1天前
匿名网友 选择了C
[195.***.***.192] 1天前
匿名网友 选择了B
[58.***.***.35] 1天前
匿名网友 选择了A
[166.***.***.174] 1天前
匿名网友 选择了A
[83.***.***.216] 1天前
匿名网友 选择了A
[213.***.***.10] 1天前
匿名网友 选择了C
[230.***.***.133] 1天前
匿名网友 选择了B
[148.***.***.250] 1天前
匿名网友 选择了C
[7.***.***.152] 1天前
匿名网友 选择了B
[147.***.***.108] 1天前
匿名网友 选择了C
[220.***.***.35] 1天前
匿名网友 选择了B
[57.***.***.141] 1天前
匿名网友 选择了C
[84.***.***.234] 1天前
加载更多
提交我的答案
登录提交答案,可赢取奖励机会。
更多“阅读下面的程序,程序的运行结果是()。classString…”相关的问题
第1题
1、下列程序运行结果是( ) public class Demo { public static void main(String[] args) { Object obj=new Father(){ public void show(){ System.out.println("helloworld"); } }; obj.show(); } } class Father{ public void show(){ System.out.println("hello father"); } }

A、A.hello father

B、B.helloworld

C、C.无结果

D、D.程序编译报错

点击查看答案
第2题
【单选题】若有下面程序, class Demo{ public static void main(String []s){ int a = 5, b = 0; a = a/b; }} 则程序运行时会抛出哪种异常( )

A、ClassNotFoundException

B、IndexOutOfBoundsException

C、NullPointerException

D、AirthmeticException

点击查看答案
第3题
现有 public class Parent{ public void change (int x){ } } public class Child extends Parent{ //覆盖父类change方法 } 下列哪个声明是正确的覆盖了父类的change方法?

A、protected void change (int x){}

B、public void change(int x, int y){}

C、public void change (int x){}

D、public void change (String s){}

点击查看答案
第4题
下面程序的运行结果()(选择一项)public static void main(String[] args) { Thread t=new Thread(){ public void run(){ pong(); } }; t.run(); System.out.println("ping"); } static void pong(){ System.out.println("pong"); }

A、pingpong

B、pongping

C、pingpong和pongping都有可能

D、都不输出

点击查看答案
第5题
和下面代码能完成相同的选项是() class Demo { public static void main(String[] args) { int i = 1; int sum = 0; while (i <= 2="=" 100) { if (i % 0) sum="sum" + i; } i++; system.out.println(sum);> A、for (int x =1; x<=100;x++){ sum="sum+x;}&lt;br"> B、for (int x =0; x<=100;x+=2){ sum="sum+x;}&lt;br"> C、for (int x =1; x<=100;x+=2){ sum="sum+x;}&lt;br"> D、上述全对
点击查看答案
第6题
5、下面程序的运行结果是( ) public class Demo { public static void main(String[] args) { try { System.out.println(10 / 0); } catch (RuntimeException e) { System.out.println("RuntimeException"); } catch (ArithmeticException e) { System.out.println("ArithmeticException"); } } }

A、A.编译失败

B、B.编译通过,没有结果输出

C、C.输出:RuntimeException

D、D.输出:ArithmeticException

点击查看答案
第7题
以下程序调试结果为( )。 public class Test { int m = 5; public void some(int x) { m = x; } public static void main(String args[ ]) { new Demo().some(7); } } class Demo extends Test { int m = 8; public void some(int x) { super.some(x); System.out.println(m); } }

A、5

B、8

C、7

D、无任何输出

点击查看答案
第8题
以下程序的输出结果为( )。 class A { void test() { System.out.print("A"); } } class B extends A { void test() { super.test(); System.out.println("B"); } } class Main{ public static void main(String[] args) { A a = new B(); a.test(); } }
点击查看答案
第9题
public class Example { public static void main(String[] args) { try{ int rst = 4/0; System.out.println("ret = "+rst); }catch(Exception e){ System.out.println("catch语句块执行"); return; }finally{ System.out.println("finally语句块执行"); } System.out.println("程序继续向下执行"); } } 运行以上程序,输出的结果是( )

A、catch语句块执行

B、catch语句块执行 程序继续向下执行

C、catch语句块执行 finally语句块执行

D、程序继续向下执行

点击查看答案
账号:
你好,尊敬的用户
复制账号
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改
欢迎分享答案

为鼓励登录用户提交答案,简答题每个月将会抽取一批参与作答的用户给予奖励,具体奖励活动请关注官方微信公众号:简答题

简答题官方微信公众号

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

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

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