精品文档一: 选择题1. 关于以下程序代码的说明正确的是( D ) HasStatic{2. private static int x=100;3. public static void main(String args[ ]){4. HasStatic hs1=new HasStatic( );5. ++;6. HasStatic hs2=new HasStatic( );7. ++;8. hs1=new HasStatic( );9. ++;10. - -;11. (“x=”+x);12. }13. }A、 5 行不能通过编译,因为引用了私有静态变量B、 10 行不能通过编译,因为 x 是私有静态变量C、 程序通过编译,输出结果为:x=103D、 程序通过编译,输出结果为:x=1022. 下列关于for循环和while循环的说法中哪个是正确的?( B ) 循环能实现的操作,for 循环判断条件一般是程序结果,for ,循环体不能为空3. 以下选项中循环结构合法的是( C )A、while (int i<7){ i++;(“i is “+i);}B、 int j=3;while(j){(“ j is “+j);}C、int j=0;for(int k=0; j + k !=10; j++,k++){(“ j is “+ j + “k is”+ k);}D、 int j=0;do{( “j is “+j++);if (j = = 3) {continue loop;}}while (j<10);4. 给出下面代码段 , 哪行将引起一个编译时错误?( D )1) public class Test {精品文档精品文档2) int n = 0;3) int m = 0;4) public Test(int a) { m=a; }5) public static void main(String arg[]) {6) Test t1,t2;7) int j,k;8) j=3; k=5;9) t1=new Test();10) t2=new Test(k);11) }12) }A. 行 1 B. 行 4 C. 行 6 D. 行 95. 下面的方法,当输入为 2的时候返回值是多少 ?( D )public int getValue(int i) {int result = 0;switch (i) {case 1:result = result + i;case 2:result = result + i * 2;case 3:result = result + i * 3;}return result;}A 0 B 2 C 4 D 10二 : 简述题1、描述一下 JVM 加载 class 文件的原理机制 ?JVM 中类的装载是由ClassLoader 和它的子类来实现的,Java Cla
最新java高级工程师面试题及答案资料 来自淘豆网www.taodocs.com转载请标明出处.