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:
M
Mr. Dubey     View Profile
Founder of MCQ Buddy. I just like to help others. This portal helps students in getting study material free. Share your stuff here so that others can get benefitted.