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 ]