更多“29、下列代码的输出结果是()。 function attr…”相关的问题
第2题
执行下列代码,程序的输出结果是(用下划线表示空格): int a=29,b=100; cout <<setw (3) << a << b << endl;
A.29_100
B._29_100
C.29100
D._29100
点击查看答案
第3题
29、下面代码的输出结果是(). X = 10 y = -1+2j print(X + y)
点击查看答案
第4题
执行下列代码,程序的输出结果是(用下划线表示空格): int a=29,b=100; cout <<setw (3) << a << b << endl;
A.29_100
B._29_100
C.29100
D._29100
点击查看答案
第5题
29、下面代码的输出结果是 >>> a = b = c =123 >>> print(a,b,c)
A.出错
B.0 0 123
C.123 123 123
D.1 1 123
点击查看答案
第6题
对于下列代码,下列哪个叙述是正确的? class A { public int i=0; A(int m) { i = 1; } } public class B extends A { B(int m) { i = 2; } public static void main(String args[]){ B b = new B(100); System.out.println(b.i); //【代码】 } }
A.程序提示编译错误。
B.编译无错误,【代码】输出结果是0。
C.编译无错误,【代码】输出结果是1。
D.编译无错误,【代码】输出结果是2。
点击查看答案
第7题
3.对于如下代码,下列哪个叙述是正确的? public class E{ public static void main(String[] args){ String strOne="bird"; String strTwo=strOne; strOne="fly"; System.out.println(strTwo); } }
A.程序编译出现错误。
B.程序标注的【代码】的输出结果是bird。
C.程序标注的【代码】的输出结果是fly。
D.程序标注的【代码】的输出结果是null。
点击查看答案
第8题
对于下列代码,下列哪个叙述是正确的? class A { public int i=0; A(int m) { i = 1; } } public class B extends A { B(int m) { i = 2; } public static void main(String args[]){ B b = new B(100); System.out.println(b.i); //【代码】 } }
A.程序提示编译错误。
B.编译无错误,【代码】输出结果是0。
C.编译无错误,【代码】输出结果是1。
D.编译无错误,【代码】输出结果是2。
点击查看答案