Candibiotic
News Update :

Static methods cant be overridden

Wednesday, July 15, 2009

A static method cannot override an inherited instance method, but it can hide a static method if the exact requirements for overriding instance methods are fulfilled. A hidden superclass static method is not inherited. The compiler will flag an error if the signatures are the same but the other requirements regarding return type, throws clause, and accessibility are not met. If the signatures are different, the method name is overloaded, not hidden.

Moreover, the static methods belong to a class and available to all the instances of that particular class.
Share this Article on :

0 comments:

Post a Comment

 

© Copyright Vinayak Wins 2010 -2011 | Design by Herdiansyah Hamzah | Published by Borneo Templates | Powered by Blogger.com.