This Question is not quite clear ...
By "What can be inserted at // 1,"and by the answer "obj.name = null; as well as obj = null;" I unterstand there can be inserted "obj.name = null" as well as there can be inserted "obj = null;"
About Question enthuware.ocajp.i.v7.2.884 :
Moderator: admin
-
- Posts: 2
- Joined: Tue Oct 15, 2013 3:19 pm
- Contact:
-
- Site Admin
- Posts: 10090
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.884 :
No, as the explanation says, obj.name = null; is not required to make obj eligible to be garbage collected.
You only need obj = null;
obj.name = null; will not make obj eligible to be garbage collected.
HTH,
Paul.
You only need obj = null;
obj.name = null; will not make obj eligible to be garbage collected.
HTH,
Paul.
If you like our products and services, please help us by posting your review here.
-
- Posts: 2
- Joined: Fri Sep 02, 2016 3:19 am
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.884 :
The question is to pick one answer that makes the object eligible for garbage collection. There are two such options that achieve this, even if the second includes some irrelevant code.
imo, it's poorly worded because the fifth answer is not incorrect.
imo, it's poorly worded because the fifth answer is not incorrect.
-
- Site Admin
- Posts: 10090
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.884 :
You may find such options in the real exam also. You need to pick the best answer.
HTH,
Paul.
HTH,
Paul.
If you like our products and services, please help us by posting your review here.
-
- Posts: 1
- Joined: Mon Apr 22, 2024 3:23 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.884 :
I didn't quite understood this question, from what i recall an object is elegible for garbage collection once there are no more references pointing to it, or all of those references are out of scope. So, from my understanding both "obj.name = null; as well as obj = null;" make this condition true, therefore it looks the more righteous answer since it addresses both scenarios.
-
- Site Admin
- Posts: 10090
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.884 :
Please response above.
If you like our products and services, please help us by posting your review here.
Who is online
Users browsing this forum: Bing [Bot] and 18 guests