一、 选择是 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
给出下面代码: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 编译时正确,但运行时错误
给出下面代码段1) public class Test { 2) int m, n; 3) public Test() {} 4) public Test(int a) { m=a; } 5) public static void