下面代码的运行结果为:( )public class Qlac{static String arr[] = new String[5];public static void main(String args[ ]) {System.out.println(arr[1]);}}
A: 编译正确,运行时将产生错误
B: 输出0
C: 输出null
D: 编译时将产生错误
A: 编译正确,运行时将产生错误
B: 输出0
C: 输出null
D: 编译时将产生错误
举一反三
- 阅读下列代码: public class Person{ static int arr[]=new int[10]; public static void main(String args){ System.out.println(arr [9]); } } 该代码的运行结果是______。 A: 编译时将产生错误 B: 编译时正确,运行时将产生错误 C: 输出零 D: 输出空
- 阅读下面代码段:public class Demo{public static void main (String[] args){int[] arr = new int [10];System.out.println(arr[1]);}}执行结果正确的说法是( ) A: 编译时将产生错误 B: 编译时正确,运行时将产生错误 C: 输出0 D: 输出空
- public class T10 {static int arr[] = new int[10];public static void main(String a[]) {System.out.println(arr[1]);}}哪个语句是正确的?( ) A: 编译时将产生错误 B: 编译时正确,运行时将产生错误 C: 输出0 D: 输出null
- 给出下列代码:public class ArrayTest{static int arr[] = new int[10];public static void main(String args[]) { System.out.println(arr[1]); }}下列哪个结论是正确的?( ) A: 编译时将产生错误 B: 编译时正确,运行时将产生错误 C: 输出零 D: 输出空
- 阅读下列代码public class Person{ static int arr[ ] = new int (10); public static void main (String args ) { System.out.println(arr[9]); }}该代码运行的结果是: A: 编译时将产生错误 B: 编译时正确,运行时将产生错误 C: 输出0 D: 输出空