Tuesday, September 13, 2011

JAVA :READ SOMETHING IMPORTANT ABOUT INTERFACE

                         
      i)                    All interface methods are implicitly public and abstract. In other words,
you do not need to actually type the public or abstract modifiers in the
method declaration, but the method is still always public and abstract.

ii)                   All variables defined in an interface must be public, static, and final
in other words, interfaces can declare only constants, not instance variables

iii)                 Interface methods must not be static.

iv)           Because interface methods are abstract, they cannot be marked final,
strictfp, or native.

v)                  An interface can extend one or more other interfaces.

vi)                An interface cannot extend anything but another interface.

vii)              An interface cannot implement another interface or class.

viii)            An interface must be declared with the keyword interface.

ix)                  Interface types can be used polymorphically

No comments:

Post a Comment