Page 1 of 1
About Question enthuware.ocajp.i.v7.2.1139 :
Posted: Sun May 27, 2012 10:45 am
by ETS User
Why 'abstract' modifier is considered only as valid for class? What about abstract method definitions in abstract classes?
Re: About Question enthuware.ocajp.i.v7.2.1139 :
Posted: Sun May 27, 2012 11:16 am
by admin
'abstract' is indeed valid for a method. However, in this question, the options are not reusable. So if you use abstract for a method, you will not be able to complete the answer (because you cannot use native or static for a class). Therefore, in this case, abstract should be used for method.
PS. static can be used in an inner class but the question specifies, "Assume that the class is not declared inside another class."
HTH,
Paul.