移动端

  • 题王微信公众号

    题王微信公众号

    微信搜“题王网”真题密题、最新资讯、考试攻略、轻松拿下考试

多选题

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

发布日期:2021-10-11

class A {  }  class Alpha {  private A myA = new A...
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.

标签: "暂无标签"

题王网让考试变得更简单

扫码关注题王,更多免费功能准备上线!