在JAVA 中( )
A. 一个子类可以有多个父类,一个父类也可以有多个子类
B. 一个子类可以有多个父类,但一个父类只可以有一个子类
C. 一个子类可以有一个父类,但一个父类可以有多个子类
D. 上述说法都不对
Person p;
Teacher t;
Student s; //p, t and s are all non-null.
if(t instanceof Person) { s = (Student)t; }
最后一句语句的结果是( )
A. 将构造一个Student对象; B. 表达式是合法的;
C. 表达式是错误的; D. 编译时正确,但运行时错误。
给出下面代码:
public class test{
static int a[] = new a[10];
public static void main(String args[]) {
System.out.println(arr[10]);
}
}
下列选项正确的是( )
A. 编译时将产生错误; B. 编译时正确,运行时将产生错误;
C. 输出零; D. 输出空。