SCJP程序员认证考试

单选题package test1;  public class Test1 {  static int x = 42;  }  package test2;  public class Test2 extends test1.Test1 {  public static void main(String[] args) { System.out.println(“x = “ + x);  }  }  What is the result?()Ax = 0Bx = 42CCompilation fails 

题目
单选题
package test1;  public class Test1 {  static int x = 42;  }  package test2;  public class Test2 extends test1.Test1 {  public static void main(String[] args) { System.out.println(“x = “ + x);  }  }  What is the result?()
A

 x = 0

B

 x = 42

C

 Compilation fails because of an error in line 2 of class Test2.

D

 Compilation fails because of an error in line 3 of class Test1.

E

 Compilation fails because of an error in line 4 of class Test2.

参考答案和解析
正确答案: B
解析: 暂无解析
更多“单选题package test1;  public class Test1 {  static int x = 42;  }  package test2;  public class Test2 extends test1.Test1 {  public static void main(String[] args) { System.out.println(“x = “ + x);  }  }  What is the result?()A  x = 0B  x = 42C  Compilation ”相关问题