What the relation between Static method in Interface
Posted on May 25th , 2009 by Admin
|
|
Static methods are common in class. In object oriented , an interface is not technically a class, it is a type, but not a class so interfaces do not extend Object. Because interfaces are not classes, they cannot have static methods, because there is no actual class to attach to.We may call InterfaceName.class to get the Class Object corresponding to the interface, but the Class class specifically states that it represents classes and interfaces in a object |
| oriented application. However, the interface itself is not treated as a class, and hence you cannot attach a static method.
|
|
|