• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

static method

 
Praveen Ravinuthala
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when we override static method in subclass,

if we use polymorphism to call to subclass method through super class reference ,the super class static method will be executed.But when we create object separately for subclass and subclass static method called by using object,then subclass will be executed.why?
 
Campbell Ritchie
Sheriff
Pie
Posts: 49841
70
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can’t override static methods. Start with this FAQ.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic