This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

overriding question required

 
Inuka Vincit
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
PETER CARTER
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 724
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
static methods also couldn't be overriden.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic