You are here: Home / Topics / Program to Implement a class from multiple interfaces in Java

Program to Implement a class from multiple interfaces in Java

Filed under: Java on 2023-09-17 13:18:41

// Program to Implement a class from multiple interfaces.

interface  A
{
void showA();
}

interface  B 
{
void showB();
}

class  C  implements  A, B
{
public void showA()
{
 System.out.println("showA() of A interface.");
}

public void showB()
{
 System.out.println("showB() of B interface.");
}
}

class InterfaceTest8
{
public static void main( String args[ ] )
{
 C  t = new  C();
 t.showA();
 t.showB();
}
}


Output:

showA() of A interface.
showB() of B interface.

About Author:
S
Shyam Dubey     View Profile
If you are good in any field. Just share your knowledge with others.