black

SCJP程序员认证考试

登录

单项选择题

Which is the earliest line in the following code after which the object created on the line marked (0) will be a candidate for being garbage collected, assuming no compiler optimizations are done? () 
public class Q76a9 {  
static String f() {  
String a = "hello";  
String b = "bye"; // (0) 
 String c = b + "!"; // (1)  
String d = b;  b = a; // (2)  
d = a; // (3)  
return c; // (4)  }  
public static void main(String args[]) { 
 String msg = f();  
System.out.println(msg); // (5) 
 }  
}  

A.The line marked (1).
B.The line marked (2).
C.The line marked (3).
D.The line marked (4).
E.The line marked (5).

相关考题

多项选择题 Which statements can be inserted at the indicated position in the following code to make the program write 1 on the standard output when run?()  public class Q4a39 {  int a = 1;   int b = 1;   int c = 1;   class Inner {   int a = 2;  int get() {   int c = 3;   // insert statement here  return c;   }   }  Q4a39() {   Inner i = new Inner();   System.out.println(i.get());  }   public static void main(String args[]) {   new Q4a39();   }   }

单项选择题 HowdoestheweightypropertyoftheGridBagConstraintsobjectsusedingridbaglayoutaffectthelayoutofthecomponents?()

多项选择题 Which lines of code are valid declarations of a native method when occurring within the declaration of the following class?()    public class Qf575 {   // insert declaration of a native method here   }

All Rights Reserved 版权所有©建筑考试题库(jzkao.com)

备案号:湘ICP备2020024380号-3