Multiple inheritance cannot be achieved in java. To overcome this problem Interface concept is introduced.
An interface is a template which has only method declarations and not the method implementation.
Example:
public abstract interface IManupulation{ //Interface declaration public abstract void add(); //method declaration public abstract void subtract(); }
public class Manupulation implements IManupulation{ //Manupulation class uses the interface public void add(){ } public void subtract(){ } }
We covered nearly 50 + primary Java interview questions in this tutorial for fresh and experienced candidates. Q.1- What is… Read More