Interface

Interface

Interface sen
{
      void show();
}
class First implements sen()
{
  void show()
{
     System.out.println(“first”);
}
}
class all
{
public static void main(String args[])
{
     First f=new First();
     f.show();
}

}

Interface can be extended

interface A
{
    void show();
}
Interface B extends A
{
       void show1();
}
class c implements B
{
       void show(){System.out.println("a”); }
       void show1(){ System.out.println("b”); }
}

No comments:

Post a Comment

Loading