Thursday, November 11, 2010

Program using Super Keyword


class Base
{
  public void print()
  {
    System.out.println("I m super class");
  }
}

public class Base
{
  public void printsuper()
  {
    super.print();
  }
  public void print()
  {
    System.out.println("I m Derived class");
  }
  public static void main(String s[])
  {
 Super su=new Super();
    su.printsuper();
    su.print();
  }
}
Output



No comments: