1、选择题1:1.Give the following method: 2. public void method( ){ 3. String a,b; 4. a=new String(“hello world”); 5. b=new String(“game over”); 6. System.out.println(a+b+”ok”); 7. a=null; 8. a=b; 9. System.out.println(a); 10. } 11.In the absence o
2、f compiler optimization, which is the earliest point the object a refered is definitely elibile to be garbage collection. Givethefollowingmethod:publicvoidmethod(){Stringa,b;a=newString(“helloworld”);b=newString(“gameover”);System.out.println(a+b+”ok
8、r(;;);C.intk=1000;do{++k;}while(k>=10000);D.ints=36;while(s);--s;8:1.Give the following java source fragement: 2.//point x 3.public class Interesting{ 4.//do something 5.} 6.Which statement is correctly Java syntax at point x? Givethefo