About Question enthuware.ocajp.i.v7.2.884 :

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
morris
Posts: 2
Joined: Tue Oct 15, 2013 3:19 pm
Contact:

About Question enthuware.ocajp.i.v7.2.884 :

Post by morris »

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;"

admin
Site Admin
Posts: 10066
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocajp.i.v7.2.884 :

Post by admin »

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.
If you like our products and services, please help us by posting your review here.

ErikSKan
Posts: 2
Joined: Fri Sep 02, 2016 3:19 am
Contact:

Re: About Question enthuware.ocajp.i.v7.2.884 :

Post by ErikSKan »

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.

admin
Site Admin
Posts: 10066
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocajp.i.v7.2.884 :

Post by admin »

You may find such options in the real exam also. You need to pick the best answer.
HTH,
Paul.
If you like our products and services, please help us by posting your review here.

diogo_loureiro933
Posts: 1
Joined: Mon Apr 22, 2024 3:23 pm
Contact:

Re: About Question enthuware.ocajp.i.v7.2.884 :

Post by diogo_loureiro933 »

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.

admin
Site Admin
Posts: 10066
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocajp.i.v7.2.884 :

Post by admin »

Please response above.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 139 guests