单项选择题

下列程序段的输出结果是 String MyStr = "Hello,"; MyStr = MyStr + "World!"; System.out.println(MyStr);

A.Hello,World!
B.Hello,
C.World!
D.该程序段有语法错误
<上一题 目录 下一题>
热门 试题

单项选择题
在下列源代码文件Test.java中,哪个选项是正确的类定义A)public class test{ public int x=0; public test(int x ) { this.x=x; } }B)public class Test { public int x=0; public Test(int x ) { this.x=x; } }C)public class Test extends T1 T2 { public int x=0; public Test(int x){ this.x=x; } }D)protected class Test extends T2 { public int x=0; public Test(int x) { this.x=x; } }
在下列源代码文件Test.java中,哪个选项是正确的类定义A)public class test{ public int x=0; public test(int x ) { this.x=x; } }B)public class Test { public int x=0; public Test(int x ) { this.x=x; } }C)public class Test extends T1 T2 { public int x=0; public Test(int x){ this.x=x; } }D)protected class Test extends T2 { public int x=0; public Test(int x) { this.x=x; } }
单项选择题
为了区分类中重载的同名的不同的方法,要求
A.采用不同的形式参数列表
B.返回值的数据类型不同
C.调用时用类名或对象名做前缀
D.参数名不同
相关试题
  • 如果容器采用 【14】 进行布局管理,在...
  • setLayout( )方法是所有容器的父类 【...
  • 【12】 类是提供线程操作和管理的类。
  • Java程序中定义接口所使用的关键字是 【1...
  • 对象是一组相关变量和相关方法的封装体,是...