网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
给出下面代码:public class Person{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 Person{static int arr[] = new int[10];public static void main(String a[]) {System.out.println(arr[1]);}}以下那个说法正确? A. 编译时将产生错误;B. 编译时正确,运行时将产生错误;C. 输出0;D. 输出null。 ” 相关考题
考题 能将程序补充完整的选项是( )。class Person{ private int a; public int change(int m){ return m; }}public class Teacher extends Person{ public int b; public static void main(String arg[]) { Person p = new Person(); Teacher t = new Teacher(); int i; ______ }} B.A.i=mB.i=bC. i=p.aD.i=p. change(50)

考题 阅读下面的程序: public class Person{ int arr[ ]=Hew int[10]; public static void main(String args[ ]){ System.out.println(arr[1]); } } 正确的说法是______。A.编译时将产生错误B.编译时正确,运行时将产生错误C.输出为0D.输出为空

考题 阅读下列代码后 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 Q{public static void main(String argvr)){int anar[]=new int[5];System.out.println(anar[0]);}}

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

考题 下面程序的输出结果是什么? class C1{ static int j=0; public void method(int a){ j++; } } class Test extends C1{ public int method(){ return j++; } public void result(){ method(j); System.out.println(j+method()); } public static void main(String args[]){ new TeA.0B.1C.2D.3

考题 下列代码的执行结果是public class Test{ public int aMethod(){ static int i=0; i++; System.out.println(i); } public static void main(String args[]){ Test test= new Test(); test. aMethod(); }}A.编译错误B.0C.1D.运行成功,但不输出

考题 阅读下面代码 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 Man { static int arr[]= new int [10]; public static void main (String a []){ System.out.println(arr[1]); }}A.编译时将发生错误B.编译时正确但是运行时出错C.输出为0D.输出为null

考题 interface A{int x = 0;}class B{int x =1;}class C extends B implements A {public void pX(){System.out.println(x);}public static void main(String[] args) {new C().pX();}}

考题 执行下面程序段的输出结果为( )。 public class Q { public static void main(String argv[]) { int anar[]一new int[5]; System.out.println(anar[0]); } }A.0B.1C.2D.5

考题 阅读下列代码: 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 Man { static int arr[]=new int[10]; public static void mam(String a[]) { System.out.println(arr[1]); { }A.编译时将发生错误B.编译时正确但是运行时出错C.输出为0D.输出为null

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

考题 给出下面的程序: public class ex49 { static int arr[] = new int[10]; public static void main(String args [] ) { System.out.println (art [1] ); } } ______叙述是正确的。A.编译时将发生错误B.输出为 nullC.输出为0D.编译时正确但是运行时出错

考题 以下代码的输出结果?public class Test{int x=3;public static void main(String argv[]){int x= 012;System.out.println(x);}} A.12B.012C.10D.3

考题 下面程序的输出结果是() public class Test{  public static void main(String[] args){    String s = “abc dsf ghi”;  String[] arr = s.split(“/s”);   System.out.println(arr.length);  } }A、 编译报错B、 2C、 1D、 3

考题 1) class Person { 2) public void printValue(int i, int j) {/*…*/ }    3) public void printValue(int i){/*...*/ }    4) } 5) public class Teacher extends Person {    6) public void printValue() {/*...*/ }    7) public void printValue(int i) {/*...*/}    8) public static void main(String args[]){    9) Person t = new Teacher();    10) t.printValue(10);   11) }    12) } Which method will the statement on line 10 call?()    A、 on line 2B、 on line 3C、 on line 6D、 on line 7

考题 对于下列代码: 1) class Person {   2} public void printValue(int i, int j) {//... }     3} public void printValue(int i){//... }    4} }   5) public class Teacher extends Person { 6} public void printValue( ) {//... }     7} public void printValue(int i) {//...}     8} public static void main(String args[]){     9} Person t = new Teacher( );     10} t.printValue(10);     11} } 第10行语句将调用哪行语句?()A、 line 2B、 line 3C、 line 6D、 line 7

考题 class Top {  static int x = 1;  public Top(int y) { x *= 3; }  }  class Middle extends Top {  public Middle() { x += 1; }  public static void main(String [] args) {  Middle m = new Middle();  System.out.println(x);  }  }  结果为:() A、1B、2C、3D、编译失败

考题 Given the following code:     public class Person{     int arr[] = new int[10];  public static void main(String a[]) {     System.out.println(arr[1]);     }     }  Which statement is correct?() A、 When compilation some error will occur.B、 It is correct when compilation but will cause error when running.C、 The output is zero.D、 The output is null.

考题 public class Yikes {  public static void go(Long n) {System.out.println(”Long “);}  public static void go(Short n) {System.out.println(”Short “);}  public static void go(int n) {System.out.println(”int “);}  public static void main(String [] args) {  short y= 6;  long z= 7;  go(y);  go(z);  }  }  What is the result?() A、 int LongB、 Short LongC、 Compilation fails.D、 An exception is thrown at runtime.

考题 Given the following code:     public class Person{ static int arr[] = new int[10];  public static void main(String a[]) {     System.out.println(arr[1];)     }     }  Which statement is correct?()   A、 When compilation some error will occur.B、 It is correct when compilation but will cause error when running.C、 The output is zero.D、 The output is null.

考题 单选题Given the following code:     public class Person{ static int arr[] = new int[10];  public static void main(String a[]) {     System.out.println(arr[1];)     }     }  Which statement is correct?()A  When compilation some error will occur.B  It is correct when compilation but will cause error when running.C  The output is zero.D  The output is null.

考题 单选题1) class Person {  2) public void printValue(int i, int j) {/*…*/ }     3) public void printValue(int i){/*...*/ }     4) }  5) public class Teacher extends Person {     6) public void printValue() {/*...*/ }     7) public void printValue(int i) {/*...*/}     8) public static void main(String args[]){     9) Person t = new Teacher();     10) t.printValue(10);     11) }    12) }  Which method will the statement on line 10 call? ()A  on line 2B  on line 3C  on line 6D  on line 7

考题 单选题Given the following code:     public class Person{     int arr[] = new int[10];  public static void main(String a[]) {     System.out.println(arr[1]);     }     }  Which statement is correct?()A  When compilation some error will occur.B  It is correct when compilation but will cause error when running.C  The output is zero.D  The output is null.

考题 单选题对于下列代码: 1) class Person {   2} public void printValue(int i, int j) {//... }     3} public void printValue(int i){//... }    4} }   5) public class Teacher extends Person { 6} public void printValue( ) {//... }     7} public void printValue(int i) {//...}     8} public static void main(String args[]){     9} Person t = new Teacher( );     10} t.printValue(10);     11} } 第10行语句将调用哪行语句?()A  line 2B  line 3C  line 6D  line 7