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
- Posts: 4
- Joined: Tue Dec 06, 2016 4:11 am
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.
- Site Admin
- Posts: 8134
- Joined: Fri Sep 10, 2010 9:26 pm
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!
If you like our products and services, please help us by posting your review here
Users browsing this forum: No registered users and 4 guests