-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlaceSetting.java
More file actions
80 lines (73 loc) · 1.08 KB
/
PlaceSetting.java
File metadata and controls
80 lines (73 loc) · 1.08 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
class Plate
{
Plate(int i)
{
System.out.println("Plate constructor");
}
}
class DinnerPlate extends Plate
{
DinnerPlate(int i)
{
super(i);
System.out.println("DinnerPlate constructor");
}
}
class Utensil
{
Utensil(int i)
{
System.out.println("Utensil constructor");
}
}
class Spoon extends Utensil
{
Spoon(int i)
{
super(i);
System.out.println("Spoon constructor");
}
}
class Fork extends Utensil
{
Fork(int i)
{
super(i);
System.out.println("Fork constructor");
}
}
class Knife extends Utensil
{
Knife(int i)
{
super(i);
System.out.println("Knife constructor");
}
}
class Custom
{
Custom(int i)
{
System.out.println("Custom constructor");
}
}
public class PlaceSetting extends Custom
{
private Spoon sp;
private Fork frk;
private Knife kn;
private DinnerPlate pl;
public PlaceSetting(int i)
{
super(i+1);
sp = new Spoon(i+2);
frk = new Fork(i+3);
kn = new Knife(i+4);
pl = new DinnerPlate(i+5);
System.out.println("PlaceSetting constructor");
}
public static void main(String[] args)
{
PlaceSetting x = new PlaceSetting(9);
}
}