About Question enthuware.ocajp.i.v7.2.884 :
Moderator: admin
-
- Posts: 2
- Joined: Tue Oct 15, 2013 3:19 pm
- Contact:
About Question enthuware.ocajp.i.v7.2.884 :
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;"
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;"
-
- Site Admin
- Posts: 10384
- 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.
-
- 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: 10384
- 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.
-
- 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: 10384
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.884 :
Please see response above.
-
- Posts: 167
- Joined: Sun Apr 21, 2024 10:43 am
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.884 :
i agree the question is not clear enough, i'm not mad at entuwearEnthuware but at Oracle, it's not good enough for them to make a very difficult language ... they need to make questions as much as ambiguous possible in extra... poor consideration for the devs working with their language
Last edited by admin on Thu Dec 19, 2024 1:38 am, edited 1 time in total.
Reason: Please do not misspell names.
Reason: Please do not misspell names.
Who is online
Users browsing this forum: Bing [Bot] and 12 guests