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

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

Moderator: admin

Post Reply
ETS User

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

Post by ETS User »

Why 'abstract' modifier is considered only as valid for class? What about abstract method definitions in abstract classes?

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

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

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

Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests