wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes static methods redefining Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "static methods redefining" Watch "static methods redefining" New topic

static methods redefining

Andriy Fedotov
Ranch Hand

Joined: Mar 07, 2008
Posts: 49
Static methods are part of class not the object. Meaning that they can't be overridden, only redefined.
Why then they obey the rule of overriding like method can't throw more or broader exceptions and can't return type other than in parent class (if arguments are the same).
Or this question doesn't have answer other than "Sun decided to do so".

Thanks a lot!
Andriy Fedotov
Ranch Hand

Joined: Mar 07, 2008
Posts: 49
well, it doesn't matter how it calls - hiding or redefining.. It's not overriding for sure.
Ram Manoj
Ranch Hand

Joined: Jan 12, 2008
Posts: 52
I guess static methods can be overridden. And so overriding rules apply.
I agree. Here's the link: http://aspose.com/file-tools
subject: static methods redefining
Similar Threads
static synchronized method?
static methods and EJB
Redefining a static method in subclass
prefer static methods over non static methods
Overridding Doubt