一、 选择是 int 型 public 成员变量 , 变量值保持为常量100,用简短语句定义这个变量。A public int MAX_LENGTH=100; B final int MAX_LENGTH=100; C final public int MAX_LENGTH=100; D public final int MAX_LENGTH=100. 2.给出下面代码:1) class Parent { 2) private String name; 3) public Parent(){} 4) } 5) public class Child extends Parent { 6) private String department; 7) public Child() {} 8) public String getValue(){ return name; } 9) public static void main(String arg[]) { 10) Parent p = new Parent(); 11) } 12) } 那些行将引起错误A 第 3 行B 第 6 行C 第 7 行D 第 8 行3.类 Teacher 和 Student是类 Person的子类;Person p; Teacher t; Student s; if(t instanceof Person) { s = (Student)t; } 最后一句语句的结果是:A 将构造一个Student 对象;B 表达式是合法的;C 表达式是错误的;D 编译时正确,但运行时错误。4.给出下面代码段1) public class Test { 2) int m, n; 3) public Test() {} 4) public Test(int a) { m=a; } 5) public static void main(String arg[]) { 6) Test t1,t2; 7) int j,k; 8) j=0; k=0; 9) t1=new Test(); 10) t2=new Test(j,k); 11) } 12) } 哪行将引起一个编译时错误A line 3 B line 5 C line 6 D line 10 5.对于下列代码:1) class Person { 2) public void printValue(int i, int j) { } 3) public void printValue(int i){ } 4) } 5) public class Teacher extends Person { 6) public void printValue() { } 7) public void printValue(int i) {} 8) public static void main(String args[]){ 9) Person t = new Teacher(); 10) (10); 11) } 第 10 行语句将调用哪行语句A line 2 B line 3 C line 6 D line 7 6.哪个关键字可以抛出异常A transient B finally C throw D static ()方法的返回类型是:A int B void C boolean D static 类在哪个包中A B C D 9.对于下列代码:public class Parent { public int addValue( int a, int b) { int s; s = a+b; return s; } } class...