Page 1 of 1

About Question enthuware.ocpjp.v8.-2-.-1111 :

Posted: Wed Aug 02, 2017 10:49 am
by excluzzzive

For me the first answer is not so clear, could you clarify it:
Answer: One of the constructors of each class is called as a result of constructing an object of class C.
Explanation: To create any object one and only one constructor of that class and each of the super classes is called.
But if we create class C like this - new C("string") - also private constructor of class C would be called. So, it is already 2 constructors of class C and not 1 what is mentioned.

Thank you.

Re: About Question enthuware.ocpjp.v8.2.1111 :

Posted: Wed Aug 02, 2017 11:32 pm
by admin
Yes, you are right. The statement is actually about the constructors that are invoked from outside the constructors. It does not count the constructors that are invoked from within another constructor using this(...). I have updated the explanation to make it clear.

thank you for your feedback!