File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

static method

 
Praveen Ravinuthala
Greenhorn
Posts: 7
  • 0
  • 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: 47229
52
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can’t override static methods. Start with this FAQ.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic