需先煎的药是E.
第1题
以下程序的运行结果为()。 public class Sun { public static void main(String args[]) { String x="A",y="B",z="C"; for(int m=1;m<=2;m++) { x=y; y=z; z=x; } System.out.println(x+y+z); } }
A.ABC
B.BCA
C.BCB
D.CBC
第2题
写出程序运行结果 abstract class P{ public P() { System.out.print("parent"); } abstract void m(); } class S extends P { public S() { System.out.print("child"); } public static void main(String a[ ]) { P x= new S(); x.m(); } void m() {System.out.print("m()"); } }
第3题
写出以下程序的运行结果? public class Test{ public static void main(String argv[]){ String s = new String("hello"); myMethod(s); System.out.println("s=" + x); } public static void myMethod(String s){ s = s + "!"; } }
A、s=hello!
B、s=hello
C、hello!
D、hello
第4题
tln("haha"); } public static void main(String[] args) { ((NULL)null).haha(); } }
A.无法正常运行
B.NULL
C.null
D.haha
第5题
下列程序的运行结果是()。 public class Sun { public static void main(String args[ ]) { int number,digits; number=53; if(number<10) digits=1; else if(number<100) digits=2; else diglts=3; System.out.println(digits); } }
A.1
B.2
C.3
D.0
第6题
写出程序运行结果:class Letter { char c; } public class PassObject { static void f(Letter y) { y.c = ’z’; } public static void main(String[] args) { Letter x = new Letter(); x.c = ’a’; f(x); System.out.println(x.c); } }
第7题
A. 输出结果为 0
B. 运行出错
C. 输出结果为 null
D. 编译错误
第8题
下列程序运行后的输出结果是()。 public class Sun { public static void main(String args[]) { int i,j,s; s=0; for(i=1;i<=3;i++) for(j=0;j<=i-1;j++) s=s+1; System.out.println(s); } }
A.6
B.5
C.4
D.3
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!