About Question enthuware.ocajp.i.v7.2.912 :
Moderator: admin
-
- Posts: 1
- Joined: Thu Nov 06, 2014 5:31 pm
- Contact:
About Question enthuware.ocajp.i.v7.2.912 :
Sorry I don't understand the approach of the question, most of the "methods" in the question are no actually methods.. are constructors, and none of them return nothing.. I think the right approach would be.. "which of the follow not compile".
-
- Site Admin
- Posts: 10046
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.912 :
Right. As the explanation notes, some of them cannot be considered methods but are valid constructors. They are thus not correct choices even though they can be compiled (of course, within appropriate class code). So which of the following will not compile is not a valid question here.
If you like our products and services, please help us by posting your review here.
-
- Posts: 22
- Joined: Sat Jun 30, 2018 6:11 am
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.912 :
Hey. I always thought that the constructor is a method too. That is, if the question is formulated which METHOD, then the ' constructor ' can not be the correct answer?
-
- Site Admin
- Posts: 10046
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.912 :
No, a constructor is not a method at all. It is never inherited and it has no return type.
If you like our products and services, please help us by posting your review here.
-
- Posts: 22
- Joined: Sat Jun 30, 2018 6:11 am
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.912 :
Thank's a lot!
-
- Posts: 1
- Joined: Tue Jun 06, 2023 7:02 am
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.912 :
A quick search shows that a constructor actually is a special type of method. In which case the constructors would also be valid answers.
-
- Site Admin
- Posts: 10046
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.912 :
If any article says that a constructor can be considered a method, then that article is wrong.
If you like our products and services, please help us by posting your review here.
Who is online
Users browsing this forum: No registered users and 70 guests