- class TestA {
- TestB b;
- TestA() {
- b = new TestB(this);
- }
- }
- class TestB {
- TestA a;
- TestB(TestA a) {
- this.a = a;
- }
- }
- class TestAll {
- public static void main (String args[]) {
- new TestAll().makeThings();
- // ...code continues on
- }
- void makeThings() {
- TestA test = new TestA();
- }
- } Which two statements are true after line 15, before main completes? (Choose two)c d A. Line 15 causes a stack overflow. B. An exception is thrown at runtime. C. The object referenced by a is eligible for garbage collection. D. The object referenced by b is eligible for garbage collection. E. The object referenced by a is not eligible for garbage collection. F. The object referenced by b is not eligible for garbage collection.
一个笔试题目
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
2条回答 默认 最新
- 紫翎观星 2009-12-10 15:32关注
答案:C D
这是一个典型的孤立岛屿的例子。要记住:一个对象,它是由另一个对象引用可以有资格
垃圾收集,如果是两个对象则构成孤立的对象岛。本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报
悬赏问题
- ¥15 程序不包含适用于入口点的静态Main方法
- ¥15 素材场景中光线烘焙后灯光失效
- ¥15 请教一下各位,为什么我这个没有实现模拟点击
- ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
- ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
- ¥20 有关区间dp的问题求解
- ¥15 多电路系统共用电源的串扰问题
- ¥15 slam rangenet++配置
- ¥15 有没有研究水声通信方面的帮我改俩matlab代码
- ¥15 ubuntu子系统密码忘记