Interface in Java
Interfaces can be used to implement the Inheritance relationship between the non-related classes that do not belongs to the same hierarchy, i.e. any Class and any where in hierarchy. Using Interface, you can specify what a class must do but not how it does.
- A class can implement more than one Interface.
- An Interface can extend one or more interfaces, by using the keyword extends.
- All the data members in the interface are public, static and Final by default.
- An Interface method can have only Public, default and Abstract modifiers…. More