[单选题]

已知如下代码: public class Test long a[]=new long[10] public static void main (String args[]{ System.out.println(a[6];} 以下( )语句是正确的。

A.Output is null.

B.When running,some error will occur.

C.When compile,some error will occur.

D.Output is 0.

参考答案与解析:

相关试题

有如下代码段 public class OperatorAndException

[单选题]有如下代码段 public class OperatorAndExceptions { public static void main(String args[ ] { int i=10,j=15; System.out.println(i==j); String s1 = new String("how are you!"); String s2=new String("how are you!"); System.out.println(s1==s2); } } 其输出为( )。A.

  • 查看答案
  • 阅读下列代码后public class Person{int arr[]=new

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

  • 查看答案
  • 阅读下列代码后public class Person{int arr[]=new

    [单选题]阅读下列代码后 public class Person{ int arr[]=new int[10]; public static void main(String args[]){ System.out.println (arr[1]); } } 正确的说法是( )。A.编译时将产生错误B.编译时正确,运行时将产生错误C.输出零D.输出空

  • 查看答案
  • 阅读下列代码后public class Person{int arr[]=new

    [单选题]阅读下列代码后 public class Person{ int arr[]=new int[10]; public static void main(String args[]){ System.out.println(arr[1]); } } 正确的说法是( )。A.编译时将产生错误B.编译时正确,运行时将产生错误C.输出零D.输出空

  • 查看答案
  • 已知如下代码: booleanm=tree; if(m==false) Syst

    [单选题]已知如下代码: boolean m=tree; if(m==false) System.out.println("False"); else System.out.pfintln("True"); 执行结果是( )。A.FalseB.TrueC.无结果D.运行时出错

  • 查看答案
  • 以下代码的运行结果是______。public class exl5{ publ

    [主观题]以下代码的运行结果是______。public class exl5{public static void main(String args []){int i = 5;do{i--;if(i > 2)continue;}while(i < 0);System.out.println(i);}}

  • 查看答案
  • 已知如下代码: boolean m=true; if(m==false) Sys

    [单选题]已知如下代码: boolean m=true; if(m==false) System.out.prinfln("False"); else System.out.println("True");A.假B.真C.NoneD.An error will occur when running

  • 查看答案
  • 已知如下代码:booleanm=true;if(m=false)System.o

    [单选题]已知如下代码:booleanm=true;if(m=false)System.out.println("False");elseSystem.out.println("True");执行结果是()A . FalseB . TrueC . NoneD . 出错

  • 查看答案
  • 已知如下代码:switch(m) {case 0: System.out.pri

    [单选题]已知如下代码: switch(m) { case 0: System.out.println("Condition0"); case 1: System.out.println("Condition 1"); case 2: System.out.println("Condition 2"); case 3: System.out.println("Condition 3"); break; default: System.out.println("Other cCnditio

  • 查看答案
  • 已知类Myclass的定义如下: class MyClass{ public:

    [单选题]已知类Myclass的定义如下:class MyClass{public:MyClass(int D) {data=d;}~MyClass (){}private:int data;};下列对Myclass类对象数组的定义和初始化语句中,正确的是( )。A.) MyClass arrays[2];B.) MyClass arrays[2]={MyClass(5)};C.) MyClass arrays[2]={MyClass(5), MyClass(6)};D.) MyClass*arrays=

  • 查看答案
  • 已知如下代码:public class Testlong a[]=new lon