About Question enthuware.ocpjp.v7.2.1466 :

All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.

Moderators: Site Manager, fjwalraven

Post Reply
__JJ__
Posts: 125
Joined: Thu Jul 05, 2018 6:44 pm
Contact:

About Question enthuware.ocpjp.v7.2.1466 :

Post by __JJ__ »

The field has a value as soon as the parent constructor finishes, no?

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

Re: About Question enthuware.ocpjp.v7.2.1466 :

Post by admin »

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

__JJ__
Posts: 125
Joined: Thu Jul 05, 2018 6:44 pm
Contact:

Re: About Question enthuware.ocpjp.v7.2.1466 :

Post by __JJ__ »

I did read that. You wrote:
That is why, the field has a value even before the constructor is finished.
My point is that it has a value before "before the end of the constructor;" it has a value after the first line of the constructor, or actually, if you don't explicitly call super(), then it has a value ON the first line of the constructor.

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

Re: About Question enthuware.ocpjp.v7.2.1466 :

Post by admin »

Still not sure what yout point is. Already mentioned the following in previous post:
You should remember that all instance fields get their default values first, even before the constructor runs. These default values are 0 for numeric types, false for boolean, and null for reference types.
Not sure what is the confusion. It doesn't matter where there is a call to super construtor or not. The fields always have a well definedand known value.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 23 guests