aspose file tools
The moose likes Beginning Java and the fly likes static method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "static method" Watch "static method" New topic

static method

Praveen Ravinuthala

Joined: Aug 28, 2012
Posts: 7
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

Joined: Oct 13, 2005
Posts: 40436
You can’t override static methods. Start with this FAQ.
I agree. Here's the link:
subject: static method