以下程序运行结果为:
public class Q {
public static void main(String argv[]) {
int anar[]= new int[5];
System.out.println(anar[0]);
}
}
public class Q {
public static void main(String argv[]) {
int anar[]= new int[5];
System.out.println(anar[0]);
}
}
举一反三
- 下面程序运行结果为___________________。public class MyClass{ private static int a = 19; public static void modify(int a){ a = a + 5;} public static void main(String[] args){ modify(a); System.out.println(a); }}
- 以下程序运行结果为? public class Q { public static void main(String argv[]) { String a[]= new String[5]; System.out.println(a[0]); } }
- 当你编译运行下列程序代码,会得到什么结果? 。 private class Base{ Base(){ int i = 100; System.out.println(i); } } public class Pri extends Base{ static int i = 200; public static void main(String argv[]){ Pri p = new Pri(); System.out.println(i); } }
- 以下程序编译和运行会发生什么public class Q8 {int i = 20;static { int i = 10; }public static void main(String[] args) {Q8 a = new Q8();System.out.println(a.i);}}
- 以下程序的编译和运行结果为? abstract class Base{ abstract public void myfunc(); public void another(){ System.out.println("Another method"); } } public class Abs extends Base{ public static void main(String argv[]){ Abs a = new Abs(); a.amethod(); } public void myfunc(){ System.out.println("My Func"); } public void amethod(){ myfunc(); } }