A.编译错误;
B.运行输出 "Hello cruel world";
C.编译无错,但运行时指示没有定义构造方法。
D.编译无错,但运行时指示没有正确定义main方法。
第1题:
请在下划线处填入代码,是程序正常运行并且输出 “ Hello! ”
Class Test 【 15 】 {
Public static void main (String[] arge){
Test t = new Test();
t.start();
}
Public void run(){
System.out.println( “ Hello! ” );
}
第2题:
当你编译运行下列程序代码,会得到什么结果?
private class Base{ Base(){ int i = 100; System.out.println(i); } }
public class Pri extends Base{ staticint i = 200;
public static void main(String argv[]){ Pri p = new Pri(); System.out.println(i); } }
A.这段代码不能通过编译
B.输出200
C.输出100和200
D.输出100
第3题:
下列程序的运行结果是【 】。
public class Test {
public static void main (String args[]) {
String s1="hello!";
System.out.println (s1.toUpperCase());
}}
第4题:
A. 编译错误:anar 在引用前未初始化。
B. null
C. 0
D. 5
第5题:
A.12
B.012
C.10
D.3
第6题:
阅读下面代码 public class Test { String s="One World One Dream"; public static void main(String[] args) { System.out.println(s); } } 其运行的结果是
A.args
B.World One Dream
C.s
D.编译时出错
第7题:
A. goodmorning
B. "good"+"morning"
C. good morning
D. good+morning
第8题:
阅读下列代码 public class Test{ String s="One World One Dream"; public static void main(String args[]){ System. out. println(s); } } 其运行结果是
A.args
B.One World One Dream
C.s
D.编译时出错
第9题:
A. 5
B. x=5
C. "x="+5
D. "x="5
第10题:
A. hello
B. hello2
C. 编译报错
D. 运行报错,不能将串与整数相加