多做题,通过考试没问题!

Java认证考试

睦霖题库>其他计算机考试>Java认证考试

class A {  }  class Alpha {  private A myA = new A();  void dolt( A a ) {  a = null;  }  void tryIt() {  dolt( myA );  }  }  Which two statements are correct?()  

  • A、 There are no instanced of A that will become eligible for garbage collection.
  • B、 Explicitly setting myA to null marks that instance to be eligible for garbage collection.
  • C、 Any call on tryIt() causes the private instance of A to be marked for garbage collection.
  • D、 Private instances of A become eligible for garbage collection when instances of Alpha become eligible for garbage collection.
正确答案:B,D
答案解析:
进入题库查看解析

微信扫一扫手机做题