北京语言大学14春《JAVA语言程序设计》作业1
14春《JAVA语言程序设计》作业1
试卷总分:100 奥鹏学习网(aopeng123.cn) 发布
单选题
一、单选题(共 10 道试题,共 100 分。)
V
1. 当编译和运行下面的代码时,出现的结果为_______。public class NewClass { static int total=10; public static void main(String args[]){ new NewClass(); } public NewClass(){ System.out.println("In Test"); System.out.println(this);
A. 在第2行将出现编译错误
B. 在第9行将会出现编译错误
C. 屏幕上将会有10输出
D. 程序将会通过编译,但是会有运行时错误
需要购买答案的联系QQ:79691519满分:10 分
2. 设a=8,则表达式a 1的值是_______。
A. 1
B. 2
C. 3
D. 4
此题选: D 满分:10 分
3. 下面程序段的运行结果为_______。public class OperatorsAndExpressions { void residual(){ int i=10,j=3; float m=213.5f,n=4.0f; System.out.println(i%j); System.out.println(m%n); } public static void main(String args[]){
A. 1 1.5
B. 3 1.5
C. 1 2
D. 3 2
需要购买答案的联系QQ:79691519满分:10 分
4. 下面程序段的输出结果为_______。public class NewClass { public static void main(String args[]){ int x=10; int z; z=x++; System.out.println("x="+x+" z="+z); z=++x; System.out.println("x="+x+" z="+z); } }
A. x=11 z=10 x=12 z=12
B. x=11 z=11 x=12 z=12
C. x=11 z=11 x=11 z=12
D. x=11 z=10 x=11 z=12
需要购买答案的联系QQ:79691519满分:10 分
5. 下面程序段的输出结果为_______。public class MethLoad { public static void main(String args[]){ MethLoad classObj=new MethLoad(); classObj.methTest(4); classObj.methTest(4.0); } void methTest(double d){ double sum=2*d;
A. The result is:16 The result is:8.0
B. The result is:8.0 The result is:16
C. The result is:8 The result is:16.0
D. The result is:16.0 The result is:8
需要购买答案的联系QQ:79691519满分:10 分
6. 当编译和运行下面的代码时,出现的结果为_______。public class NewClass { static int total=10; public static void main(String args[]){ new NewClass(); } public NewClass(){ System.out.println("In Test"); System.out.println(this);
A. 在第2行将出现编译错误
B. 在第9行将会出现编译错误
C. 屏幕上将会有10输出
D. 程序将会通过编译,但是会有运行时错误
需要购买答案的联系QQ:79691519满分:10 分
7. 执行下面的程序段后,j的值为_______。public class NewClass { public static void main(String args[]){ int i=0x00E; int j=~i; System.out.print(j); } }
A. 14
B. -14
C. -15
D. 15
需要购买答案的联系QQ:79691519满分:10 分
8. 下面程序段的说法,正确的是_______。 interface Stack{ Object content[]; push(Object x); Object pop(); boolean isEmpty(); }
A. 程序可以通过编译,但运行有错误
B. 不能通过编译
C. 程序可以通过编译,运行正常
D. 以上答案都不对
需要购买答案的联系QQ:79691519满分:10 分
9. 下面程序段的输出结果为_______。public class Test { public static void main(String args[]){ char c1,c2,c3; c1=H; c2=/; c3=M; System.out.print(c1); System.out.print(c2); System.out.print(c3);
A. HM
B. H/M
C. H115
D. 无输出
需要购买答案的联系QQ:79691519满分:10 分
10. 下面程序段的运行结果为_______。public class OperatorsAndExpressions { void equalsMethod2(){ String s1=new String("hello"); String s2=new String("hello"); System.out.println(s1.equals(s2)); class MyValue{ int i;
A. true true
B. true false
C. false false
D. false true
需要购买答案的联系QQ:79691519满分:10 分
试卷总分:100 奥鹏学习网(aopeng123.cn) 发布
单选题
一、单选题(共 10 道试题,共 100 分。)
V
1. 当编译和运行下面的代码时,出现的结果为_______。public class NewClass { static int total=10; public static void main(String args[]){ new NewClass(); } public NewClass(){ System.out.println("In Test"); System.out.println(this);
A. 在第2行将出现编译错误
B. 在第9行将会出现编译错误
C. 屏幕上将会有10输出
D. 程序将会通过编译,但是会有运行时错误
需要购买答案的联系QQ:79691519满分:10 分
2. 设a=8,则表达式a 1的值是_______。
A. 1
B. 2
C. 3
D. 4
此题选: D 满分:10 分
3. 下面程序段的运行结果为_______。public class OperatorsAndExpressions { void residual(){ int i=10,j=3; float m=213.5f,n=4.0f; System.out.println(i%j); System.out.println(m%n); } public static void main(String args[]){
A. 1 1.5
B. 3 1.5
C. 1 2
D. 3 2
需要购买答案的联系QQ:79691519满分:10 分
4. 下面程序段的输出结果为_______。public class NewClass { public static void main(String args[]){ int x=10; int z; z=x++; System.out.println("x="+x+" z="+z); z=++x; System.out.println("x="+x+" z="+z); } }
A. x=11 z=10 x=12 z=12
B. x=11 z=11 x=12 z=12
C. x=11 z=11 x=11 z=12
D. x=11 z=10 x=11 z=12
需要购买答案的联系QQ:79691519满分:10 分
5. 下面程序段的输出结果为_______。public class MethLoad { public static void main(String args[]){ MethLoad classObj=new MethLoad(); classObj.methTest(4); classObj.methTest(4.0); } void methTest(double d){ double sum=2*d;
A. The result is:16 The result is:8.0
B. The result is:8.0 The result is:16
C. The result is:8 The result is:16.0
D. The result is:16.0 The result is:8
需要购买答案的联系QQ:79691519满分:10 分
6. 当编译和运行下面的代码时,出现的结果为_______。public class NewClass { static int total=10; public static void main(String args[]){ new NewClass(); } public NewClass(){ System.out.println("In Test"); System.out.println(this);
A. 在第2行将出现编译错误
B. 在第9行将会出现编译错误
C. 屏幕上将会有10输出
D. 程序将会通过编译,但是会有运行时错误
需要购买答案的联系QQ:79691519满分:10 分
7. 执行下面的程序段后,j的值为_______。public class NewClass { public static void main(String args[]){ int i=0x00E; int j=~i; System.out.print(j); } }
A. 14
B. -14
C. -15
D. 15
需要购买答案的联系QQ:79691519满分:10 分
8. 下面程序段的说法,正确的是_______。 interface Stack{ Object content[]; push(Object x); Object pop(); boolean isEmpty(); }
A. 程序可以通过编译,但运行有错误
B. 不能通过编译
C. 程序可以通过编译,运行正常
D. 以上答案都不对
需要购买答案的联系QQ:79691519满分:10 分
9. 下面程序段的输出结果为_______。public class Test { public static void main(String args[]){ char c1,c2,c3; c1=H; c2=/; c3=M; System.out.print(c1); System.out.print(c2); System.out.print(c3);
A. HM
B. H/M
C. H115
D. 无输出
需要购买答案的联系QQ:79691519满分:10 分
10. 下面程序段的运行结果为_______。public class OperatorsAndExpressions { void equalsMethod2(){ String s1=new String("hello"); String s2=new String("hello"); System.out.println(s1.equals(s2)); class MyValue{ int i;
A. true true
B. true false
C. false false
D. false true
需要购买答案的联系QQ:79691519满分:10 分
版权声明
声明:有的资源均来自网络转载,版权归原作者所有,如有侵犯到您的权益
请联系本站我们将配合处理!
上一篇 : 北京语言大学14春《教育学》作业1
下一篇 : 北京语言大学14春《西方经济学》(二)作业3