单项选择题
现有:
public interface A {}
以下哪项声明是合法的?()
A. A a = new A();
B. A[] a = new A[];
C. A[] a = new A[10];
D. 以上皆错
点击查看答案&解析
相关考题
-
单项选择题
运行时,数组以哪种方式存在?()
A.对象
B.基本类型变量
C.引用类型变量
D.视具体情况而定 -
单项选择题
程序: class TestReference{ public static void main(String[] args){ int x=2; TestReference tr = new TestReference(); System.out.print(x); tr.change(x); System.out.print(x); } public void change(int num){ num = num + 1; } } 程序运行后的输出是哪项?()
A. 23
B. 21
C. 22
D. 编译错误 -
单项选择题
程序: class TestApp{ public static void main(String[] args){ System.out.println(multiply(2,3,4,5)); } public int multiply(int[] nums){ int result = 1; for(int x :nums) result *= x; return result; } } 程序运行后的输出是哪项?()
A. 14
B. 编译错误
C. 120
D. 24
