求奥鹏作业答案北语14年

如题所述

您看看是下面这套题吗?还有几个参考答案,如果是我@可以@在@线帮@你的
14春《JAVA语言程序设计》作业1的参考答案:
一、单选题
1、C 2、D 3、A 4、A 
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. 程序将会通过编译,但是会有运行时错误
2. 设a=8,则表达式a>>>1的值是_______。A. 1
B. 2
C. 3
D. 4
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
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
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
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. 程序将会通过编译,但是会有运行时错误
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
8. 下面程序段的说法,正确的是_______。 interface Stack{ Object content[]; push(Object x); Object pop(); boolean isEmpty(); }A. 程序可以通过编译,但运行有错误
B. 不能通过编译
C. 程序可以通过编译,运行正常
D. 以上答案都不对
9. 下面程序段的输出结果为_______。public class Test { public static void main(String args[]){ char c1,c2,c3; c1='H'; c2='\\'; c3='\115'; System.out.print(c1); System.out.print(c2); System.out.print(c3);A. H\M
B. H\\\115
C. H115
D. 无输出
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追问

是的 哥们还有么

温馨提示:答案为网友推荐,仅供参考