Skip to content

Commit 974b189

Browse files
committed
Multiple Ineritance
1 parent c16c33d commit 974b189

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

MultipleInheritance.java

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
interface A{
2+
public void method();
3+
}
4+
interface B{
5+
public void method();
6+
}
7+
class C implements B,A{
8+
public void method(){
9+
System.out.println("I am A");
10+
}
11+
}
12+
class MultipleInheritance{
13+
public static void main(String[] args){
14+
C c = new C();
15+
c.method();
16+
17+
A a = new A(){
18+
public void method(){
19+
System.out.println("HAHhahahahahhaha");
20+
}
21+
};
22+
a.method();
23+
}
24+
}

0 commit comments

Comments
 (0)