You are here: Home / Topics / Program to explain partial implementation of an interface in Java

Program to explain partial implementation of an interface in Java

Filed under: Java on 2023-09-17 13:16:09

//  Program to explain partial implementation of an interface.

interface AInterface
{
void showA();
void showB();
}

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

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

class InterfaceTest3
{
public static void main( String args[ ] )
{
 AInterface  a1 = new Test();
 a1.showA();
 a1.showB();
}
}


Output:

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

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