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

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

Moderator: admin

Post Reply
TitoRobe
Posts: 1
Joined: Thu Nov 06, 2014 5:31 pm
Contact:

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

Post by TitoRobe »

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

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

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

Post by admin »

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.

st.lisker
Posts: 22
Joined: Sat Jun 30, 2018 6:11 am
Contact:

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

Post by st.lisker »

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?

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

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

Post by admin »

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.

st.lisker
Posts: 22
Joined: Sat Jun 30, 2018 6:11 am
Contact:

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

Post by st.lisker »

Thank's a lot!

johnwilkos
Posts: 1
Joined: Tue Jun 06, 2023 7:02 am
Contact:

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

Post by johnwilkos »

A quick search shows that a constructor actually is a special type of method. In which case the constructors would also be valid answers.

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

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

Post by admin »

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 23 guests