Nowadays, college students are seen waiting on tables, cleaning in stores, advertising in streets, teaching in families and doing whatever work they can find. It has become fashionable for college students to do some odd jobs in their spare time.
【单选题】对于下列代码E.java,哪个叙述是正确的? A.代码没有编译错误。 B.代码可以通过编译,但运行时触发NullPointException。 C.代码有编译错误提示:无法从静态上下文中引用非静态变量 x。 D.start方法中操作变量 y 导致编译错误。 public class E { int x; static int y; void start(){ x = 100; y = 200; }...
【判断题】下列源文件Test.java代码可以通过编译,即没有编译错误,但运行时触发异常:ArrayIndexOutOfBoundsException: 0 Test.java: public class Test { public static void main(String args[]){ int [][] a = {{1,2,3},{}}; System.out.println(a[1][0]);...
【单选题】5 阅读下面的程序, 分析代码是否能够编译通过? class A { private int secret = 5; } public class Test1 { public static void main(String[] args) { A a = new A(); System.out.println(a.secret++); } }
【判断题】下列源文件Test.java代码可以通过编译,即没有编译错误,但运行时触发异常:ArrayIndexOutOfBoundsException: 3 public class Test { public static void main(String[] args){ int [] a = {1,2,3}; System.out.println(a[3]); } }