-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInterface2.java
More file actions
49 lines (39 loc) · 946 Bytes
/
Interface2.java
File metadata and controls
49 lines (39 loc) · 946 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
48
49
//interface-interface -> extends
//class-interface -> implement
interface Student {
int f = 0;
void A();
void R();
}
//one interface can extend other Interface
interface Teacher extends Student {
void ar();
}
class NormalClass {
void insideNormal() {
System.out.println("Inside Normal");
}
}
//we can inherit from a concrete class using extend before implementing
// must override; if don't want, make it abstract too.
class Implement extends NormalClass implements Student, Teacher {
@Override
public void A() {
System.out.println("inside A ");
}
@Override
public void R() {
System.out.println("inside R ");
}
@Override
public void ar() {
System.out.println("inside ar ");
}
}
abstract class Implement2 implements Student, Teacher {
//tryna implement it without overriding
//using abstract keyword
}
public class Interface2 {
//
}