aspose file tools*
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 Soft Skills this week in the Jobs Discussion 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.
It is sorta covered in the JavaRanch Style Guide.
subject: static methods redefining