public interface InterfaceA
{
void sayHi();
}
InterfaceB.java public interface InterfaceB
{
void sayBye();
}
InterfaceC.java public interface InterfaceC extends InterfaceA, InterfaceB
{
void sayWelcome();
}
MyClass.java public class MyClass implements InterfaceC
{
@Override
public void sayHi()
{
System.out.println("Hi");
}
@Override
public void sayBye()
{
System.out.println("Bye");
}
@Override
public void sayWelcome()
{
System.out.println("Welcome");
}
}
InterfaceTest.java public class InterfaceTest
{
public static void main(String[] args)
{
InterfaceC interfaceCRef = new MyClass();
interfaceCRef.sayHi();
interfaceCRef.sayBye();
interfaceCRef.sayWelcome();
}
}