- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinterface_inheritance.java
More file actions
Latest commit
47 lines (39 loc) · 839 Bytes
/
Copy pathinterface_inheritance.java
File metadata and controls
47 lines (39 loc) · 839 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
36
37
38
39
40
41
42
43
44
45
46
47
packagecom.company;
interfaceSampleInterface
{
voidmeth1();
voidmeth2();
}
interfaceChildSampleInterfaceextendsSampleInterface
{
voidmeth3();
voidmeth4();
}
classMychildimplementsSampleInterface,ChildSampleInterface
{
@Override
publicvoidmeth1() {
System.out.println("Meth1");
}
@Override
publicvoidmeth2() {
System.out.println("meth2");
}
@Override
publicvoidmeth3() {
System.out.println("Meth3");
}
@Override
publicvoidmeth4() {
System.out.println("Meth4");
}
}
publicclassinterface_inheritance {
publicstaticvoidmain(String[] args) {
Mychildc1=newMychild();
c1.meth1();
c1.meth2();
c1.meth3();
c1.meth4();
}
}