File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

static methods redefining

 
Andriy Fedotov
Ranch Hand
Posts: 49
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
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
Posts: 49
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well, it doesn't matter how it calls - hiding or redefining.. It's not overriding for sure.
 
Ram Manoj
Ranch Hand
Posts: 52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess static methods can be overridden. And so overriding rules apply.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic