The basic Properties of Interface


1. Interface must be declared with the key word ‘interface’.

2. All interface methods are implicitly public and abstract. In another words you dont need to atually type the public or abstract modifiers in the metod declaration, but method is still allways public and abstract.

3. All variables defined in an interface is public, static, and final. In another words, interfaces can declare only constants , not instance variables.

4. Interface methods must not be static.

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

6. An interfaces can extend one or more other interfaces.

7. An interface cannot implement another interface or class.

8. interface types can be used polymorphically.

2 thoughts on “The basic Properties of Interface

  1. Anurag Singh March 30, 2018 / 7:48 am

    Thanks for this useful explanation. It is really helpful.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.