JAVA Program for using Multiple Interface

JAVA Program for using Multiple Interface:

interface Printable
{
void print();
}

interface Showable
{
void show();
}

class MultiInterface implements Printable,Showable
{
 public void print()
  {
   System.out.println("Hello");
   System.out.println("from Pritable interface");
  }

  public void show()
    {
     System.out.println("from Showable interface");
    }

public static void main(String args[])
 {
   MultiInterface obj = new MultiInterface();
   obj.print();
   obj.show();
 }
}

OUTPUT:

Hello
from Pritable interface
from Showable interface

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.