File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Win a copy of REST with Spring (video course) this week in the Spring forum!
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:
subject: static methods redefining
It's not a secret anymore!