- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInteritancenInterfaces.java
More file actions
Latest commit
35 lines (31 loc) · 721 Bytes
/
Copy pathInteritancenInterfaces.java
File metadata and controls
35 lines (31 loc) · 721 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
interfacesampleInterface{
voidmath1();
voidmath2();
}
interfacechildsampleInterfaceextendssampleInterface{
voidmath3();
voidmath4();
}
classMySampleInterfaceimplementschildsampleInterface{
publicvoidmath1(){
System.out.println("math1");
}
publicvoidmath2(){
System.out.println("math2");
}
publicvoidmath3(){
System.out.println("math3");
}
publicvoidmath4(){
System.out.println("math4");
}
}
classInteritanceInInterfaces{
publicstaticvoidmain(String[] args) {
MySampleInterfacesi = newMySampleInterface();
si.math1();
si.math2();
si.math3();
si.math4();
}
}