欢迎来到在线考试题库网 在线考试题库官网
logo
全部科目 > Java认证考试 > 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).

点击查看答案&解析

相关考题

微信小程序免费搜题
微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题