This week's book giveaways are in the iOS and Features new in Java 8 forums.
We're giving away four copies each of Barcodes with iOS: Bringing together the digital and physical worlds and Core Java for the Impatient and have the authors on-line!
See this thread and this one for details.
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 Barcodes with iOS this week in the iOS forum
or Core Java for the Impatient in the Java 8 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