东北大学2019春学期《JAVA语言程序设计Ⅰ》在线作业2-0001
	试卷总分:100    得分:100
	一、 单选题 (共 20 道试题,共 60 分)
	1.设有下面两个赋值语句: a = Integer.parseInt("1024"); b = Integer.valueOf("1024").intValue(); 下述说法正确的是( )。
	A.a是整数类型变量,b是整数类对象。
	B.a是整数类对象,b是整数类型变量。
	C.a和b都是整数类对象并且它们的值相等。
	D.a和b都是整数类型变量并且它们的值相等。
	答案来源:www.youxue100f.com正确答案:D
	
	2.下列类头定义中,错误的是( )。
	A.class x { .... }
	B.public x extends y { .... }
	C.public class x extends y { .... }
	D.class x extends y implements y1 { .... }
	正确答案:B
	
	3.选择正确的叙述. class Happy extends Frame { Happy() { SetLayout(new GridLayout(2,2)); Panel p1 = new Panel(); add(p1); p1.add( new Button("One")); Panel p2 = new Panel(); add(p2); p2.add( new Button("Two")); add( new Button("Three")); add( new Button("Four")); s
	A.当frame调整大小时,按钮Three和Four 的大小也将调整。
	B.当frame调整大小时,所有按钮的大小都将调整。
	C.当frame调整大小时,按钮Two和Four 的大小也将调整。
	D.当frame调整大小时,按钮One和Two 的大小也将调整。
	正确答案:A
	
	4.下面程序的输出结果是什么? class C1{ static int j=0; public void method(int a){ j++; } } class Test extends C1{ public int method(){ return j++; } public void result(){ method(j); System.out.println(j+method()); } public static void main(String args[]){ new Te
	A.0
	B.1
	C.2
	D.3
	正确答案:C
	
	5.给出下列代码,如何使成员变量m 被方法fun()直接访问? class Test { private int m; public static void fun() { ... } }
	A.将private int m 改为protected int m
	B.将private int m 改为 public int m
	C.将private int m 改为 static int m
	D.将private int m 改为 int m
	正确答案:C
	
	6.下面程序的输出结果是什么? class Foo{ static void change(String s){ s=s.replace('j','l'); } public static void main(String args[]){ String s="java"; change(s); System.out.println(s); } }
	A.lava
	B.java
	C.编译错误
	D.运行时出现异常
	正确答案:B
	
	7.下列程序的功能是在监控台上每隔一秒钟显示一个字符串“Hello”,能够填写在程序中下划线位置,使程序完整并能正确运行的语句是 public class Test implements Runnable{ public static void main(String args[]){ Test t=new Test(); Thread tt=new Thread(t); tt.start(); } public void run(){ for(;;){ try{
	A.sleep(1000) InterruptedException
	B.sleep(1000) RuntimeException
	C.Thread.sleep(1000) RuntimeException
	D.Thread.sleep(1000) InterruptedException
	正确答案:D
	
	8.有下面的类:   public class Example{   static int x[]=new int[15];   public static void main(String args[]){   System.out.println(x[5]);   }   } 下面的那些说法是正确的。
	A.编译时出错
	B.运行时出错
	C.输出0
	D.输出null
	正确答案:C
	
	9.下面程序运行后I的结果是什么? Class sree { fun(){ static int I =0; I++; } public static void main(String args[]) { sree obj=new sree(); obj.fun(); obj.fun(); }
	A.编译错误
	B.运行时错误
	C.1
	D.2
	正确答案:A
