09.01. Interfaces

Interfaces

  • Eclipse: Oxygen
  • Java: 1.8

This tutorial deals with interfaces. The interfaces are somewhat similar to a class but have very interesting properties. Interfaces serve as an outline of the class ‘implementing it'(inherit). The members declared in it are public, static by default.

Hence we can have a constructor for an abstract class (which will be discussed further) but not for the interface as it contains static members.

If any method (abstract by default) is not declared in the class implementing it then the class has to declared as abstract.

Filename: Iphone8.java

Filename: Oneplus5.java

Filename: Phone.java

Filename: Hello.java

Output:

Contributed by: Poonam Tomar

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments