-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain_53.java
More file actions
41 lines (41 loc) · 864 Bytes
/
Main_53.java
File metadata and controls
41 lines (41 loc) · 864 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
abstract class Base2 {
public Base2() {
System.out.println("constructor of base 2");
}
public void greet(){
System.out.println("hello");
}
abstract public void meet();
abstract public void meet2();
}
class Derived1 extends Base2{
@Override
public void meet(){
System.out.println("welcome");
}
public void meet2(){
System.out.println("afternoon");
}
}
class Child1 extends Derived1{
public void how(){
System.out.println("good");
}
}
abstract class Phone1{
abstract void on();
}
class Smart extends Phone1{
public void on(){
System.out.println("On");
}
}
public class Main_53 {
public static void main(String[] args) {
Derived1 c=new Derived1();
c.meet();
c.meet2();
Phone1 obj=new Smart();
obj.on();
}
}