Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can a Static Method Be Overriden?

 
Michael Scott
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The 'Complete Java 2 Certification Study Guide' states that 'A static method may not be overriden to be non-static.' This implies that it can only be overridden by a static method. However, according to a mock exam, the statement 'Static methods can be overridden by static methods only' is said to be false. Could someone please clarify.
Thanks very much.
 
John Paverd
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your question was answered a couple of days ago
 
Jasper Vader
Ranch Hand
Posts: 284
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so after having a look at the answers that John provided the link to, it seems that not only can a static method NOT be overridden to be a non-static method, a static method can NOT be overridden AT ALL.
...a static method can only be hidden.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic