• 2022-06-09
    给出下列代码:public class ArrayTest{static int arr[] = new int[10];public static void main(String args[]) { System.out.println(arr[1]); }}下列哪个结论是正确的?( )
    A: 编译时将产生错误
    B: 编译时正确,运行时将产生错误
    C: 输出零
    D: 输出空
  • C

    举一反三

    内容

    • 0

      阅读下列代码段:public class Person{static int arr[ ] = new int[10];      public static void main(String[] args){             System.out.println(arr[9]);           } }该代码的运行结果是() A: 编译时将产生错误 B: 编译正确,运行时将产生错误 C: 输出零 D: 输出空

    • 1

      public class T18 {[br][/br] static int arr[] = new int[10]; public static void main(String a[]) { System.out.println(arr[1]); } } 哪个语句是正确的?() A: 编译时将产生错误 B: 编译时正确,运行时将产生错误 C: 输出零 D: 输出空

    • 2

      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

    • 3

      关于下面代码的说法()是正确的?public class Example{public static void main(String[] args){int[] arr= new int[10];System.out.println(arr[1]);}} A: 编译时产生错误 B: 编译时正确,运行时将产生错误 C: 输出零 D: 输出空(null)

    • 4

      阅读下列代码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: 输出空