Why should we used Interface class?
Usually an Abstract method inherited other abstract class properties and method but it doesn't inherited a constructor. So, then we use interface class and it doesn't have any properties. It have only methods. it only inherited interface constructor. if we inherit a interface class to other class we should use implements keyword.
Parent Class:
public interface class Animal {
//Statement
public interface walk();
}
Child Class:
public class Dog implements Animal {
public interface walk(String name, String email){
//Statement
}
}
Top comments (0)