// this is a demo on how to extend interfaces

interface I1               // first interface
{
  void m1();               // method automatically becomes public 
}

interface I2 extends I1    // second interface, extending the first one    
{
  void m2();               // same as above
}

class A implements I2      // class implementing both interfaces
{
  public void m1()         // implementation of the first interface method
  {                        // failing to implement this method leads to an error
   System.out.println("Hello");
  }

  public void m2()         // implementation of the second interface method
  {
   System.out.println("Hi");
  }
}

public class Itest         // main class with main() method
{
  public static void main(String[] args)
  {
    A myClass = new A();           
    myClass.m1();          // prints "Hello"  
    myClass.m2();          // prints "Hi"
  }
}
