1.

Explain An Interface In Java Language ?

Answer»

INTERFACE in JAVA is a way to achieve the abstraction. An Interface is like a class and also can have methods and variable as a class does but Interface only contains METHOD signature and does not have a body.

  • An Interface cannot be instantiated in Java
  • An Interface includes methods which are public and abstract (by default).
  • A class can implement an interface.
  • For declaring an interface, we USE the keyword interface.

Syntax:

1. Interface Interface_Name{

2. //Methods

3. }

Interface in Java is a way to achieve the abstraction. An Interface is like a class and also can have methods and variable as a class does but Interface only contains method signature and does not have a body.

Syntax:

1. Interface Interface_Name{

2. //Methods

3. }



Discussion

No Comment Found