Basic intro about Interface class in Java
NSP.Mathi

NSP.Mathi @mathivanan8

About: I am a beginner in UI/UX design with experience in front-end development. I honed my skills through the Freshworks

Location:
Chennai, India
Joined:
Nov 18, 2022

Basic intro about Interface class in Java

Publish Date: Jul 14 '23
0 0

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();

}
Enter fullscreen mode Exit fullscreen mode

Child Class:

public class Dog implements Animal {   

public interface walk(String name, String email){
//Statement
}

}
Enter fullscreen mode Exit fullscreen mode

Comments 0 total

    Add comment