• 2022-06-08
    下列程序的运行结果是()。public class Animal {static int a[ ]=new int[10];public static void main(String args ) {System.out.println(a[9]);}}
    A: 输出零
    B: 编译时正确,运行时将产生错误
    C: 输出空
    D: 编译时将产生错误
  • B

    举一反三

    内容

    • 0

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

    • 1

      public class test{static int arr[]=new int[10];public static void main(String[] args){System.out.println(arr[10]);}}下列哪个选项是正确的 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 Demo{public static void main (String[] args){int[] arr = new int [10];System.out.println(arr[1]);}}执行结果正确的说法是( ) A: 编译时将产生错误 B: 编译时正确,运行时将产生错误 C: 输出0 D: 输出空

    • 4

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