Page 1 of 1
About Question enthuware.ocajp.i.v7.2.1162 :
Posted: Mon Aug 20, 2012 11:58 pm
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.
Re: About Question enthuware.ocajp.i.v7.2.1162 :
Posted: Wed Aug 22, 2012 10:46 pm
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.
Re: About Question enthuware.ocajp.i.v7.2.1162 :
Posted: Sat Sep 01, 2012 8:09 pm
by Guest
constructor's can't be final though can they?
Re: About Question enthuware.ocajp.i.v7.2.1162 :
Posted: Sun Sep 02, 2012 6:49 am
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.
Re: About Question enthuware.ocajp.i.v7.2.1162 :
Posted: Sat Jul 13, 2013 2:58 pm
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?
Re: About Question enthuware.ocajp.i.v7.2.1162 :
Posted: Sat Jul 13, 2013 6:12 pm
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.
Re: About Question enthuware.ocajp.i.v7.2.1162 :
Posted: Sun Jul 14, 2013 7:28 am
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!
Re: About Question enthuware.ocajp.i.v7.2.1162 :
Posted: Sun Jul 14, 2013 7:34 am
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
