• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Overriding doubt ?

 
harsha puttaswamy
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can static methods be overridden in the deriving class ?

Thanks.
 
Balazs Borbely
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Static methotds cannot be overridden.

A subclass cannot override methods that are declared static in the superclass. In other words, a subclass cannot override a class method. A subclass can hide a static method in the superclass by declaring a static method in the subclass with the same signature as the static method in the superclass.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic