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

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

Moderator: admin

Post Reply
jmagago

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

Post by jmagago »

Can the method "TestClass()" be final if the class is abstract??

if the class is extended, the method couldn't be extended, isn't??

Thanks in advance.

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

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

Post by admin »

It is not necessary for an abstract class to have all its methods extensible. So it does make sense even if an abstract class has final methods.

HTH,
Paul.

Guest

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

Post by Guest »

constructor's can't be final though can they?

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

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

Post by admin »

Guest wrote:constructor's can't be final though can they?
Constructors are never inherited. So final doesn't really apply to them. But yes, you can't even put final keyword for a constructor.

HTH,
Paul.

Antenne88
Posts: 3
Joined: Sat Jul 13, 2013 2:49 pm
Contact:

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

Post by Antenne88 »

What irritates me here is that the answer 4 says "constructor", but there is no constructor. Final void TestClass has a return type. I thought there is no return type allowed for constructors? Or did I get something wrong here?

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

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

Post by admin »

Antenne88 wrote:What irritates me here is that the answer 4 says "constructor", but there is no constructor. Final void TestClass has a return type. I thought there is no return type allowed for constructors? Or did I get something wrong here?
Did you read the explanation? That is exactly why this is a wrong option!
HTH,
Paul.

Antenne88
Posts: 3
Joined: Sat Jul 13, 2013 2:49 pm
Contact:

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

Post by Antenne88 »

Thanks, guess I have to get used to the way these questions are constructed. I thought the modifiers synchronized, transient (native and volatile) were not on the 803 exam? Btw what means HTH? I really enjoy studying with your program - it's great!

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

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

Post by admin »

These modifiers are not directly on the exam but covered in variable declaration. You should at least be aware of what they do.
Hope This Helps :)

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests