This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes overriding question required Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "overriding question required" Watch "overriding question required" New topic
Author

overriding question required

Inuka Vincit
Ranch Hand

Joined: Aug 10, 2004
Posts: 175
Originally posted by David Ulicny:
static methods also couldn't be overriden.


Thats not true. A static method can be hidden by an other static method.
hiding in the Java spec

as for the question


Which two declarations prevent the overriding of a method? (Choose Two)
A. Final void methoda() {}
B. Void final methoda() {}
C. Static void methoda() {}
D. Static final void methoda() {}
E. Final abstract void methoda() {}


Assuming that you typed the question correctly...
A is synatically wrong(should be final void), C as I mentioned above doesnt prevent overriding, E is wrong because you cant have abstrct static methods.

Therefore the answeres are A and D.
[ September 27, 2004: Message edited by: Inuka Vincit ]

MCP (C# application dev 70-316) 860<br />SCJP 1.4 100% SCJD (URLyBird) 378<br />MAD 100% nuts
PETER CARTER
Ranch Hand

Joined: Aug 28, 2004
Posts: 70
Which two declarations prevent the overriding of a method? (Choose Two)
A. Final void methoda() {}
B. Void final methoda() {}
C. Static void methoda() {}
D. Static final void methoda() {}
E. Final abstract void methoda() {}
Answer: A, D
I think all right!
Why?
David Ulicny
Ranch Hand

Joined: Aug 04, 2004
Posts: 724
static methods also couldn't be overriden.


SCJP<br />SCWCD <br />ICSD(286)<br />MCP 70-216
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: overriding question required