interface Printable{
void print();
}
interface Showable{
void show();
}
class A implements Printable,Showable{
public void print(){System.out.println("Hello");}
public void show(){System.out.println("Welcome");}
}
class Multiple_inheritance{
public static void main(String args[]){
A obj = new A();
obj.print();
obj.show();
}
}
Output:
void print();
}
interface Showable{
void show();
}
class A implements Printable,Showable{
public void print(){System.out.println("Hello");}
public void show(){System.out.println("Welcome");}
}
class Multiple_inheritance{
public static void main(String args[]){
A obj = new A();
obj.print();
obj.show();
}
}
Output:
No comments:
Post a Comment