给出下面代码:
public class test{
static int a[] = new a[10];
public static void main(String args[]) {
System.out.println(arr[10]);
}
}
下列选项正确的是( )
A. 编译时将产生错误。 B. 编译时正确,运行时将产生错误。
C. 输出零。 D. 输出空。
选择答案:查看解析
设有下面的两个类定义:
class AA {
void Show(){ System.out.println(“我喜欢Java!”); }
class BB extends AA {
void Show(){ System.out.println(“我喜欢C++!”);}
则顺序执行如下语句后输出结果为:( )
AA a = new AA(); BB b = new BB();
a.Show(); b.Show();
A.我喜欢Java! B.我喜欢C++!
我喜欢C++! 我喜欢Java!
C.我喜欢Java! D.我喜欢C++!
我喜欢Java! 我喜欢C++!