About Question enthuware.ocajp.i.v7.2.1139 :
Moderator: admin
About Question enthuware.ocajp.i.v7.2.1139 :
Why 'abstract' modifier is considered only as valid for class? What about abstract method definitions in abstract classes?
-
- Site Admin
- Posts: 10384
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1139 :
'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.
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.
Who is online
Users browsing this forum: No registered users and 11 guests