-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSolution.java
More file actions
96 lines (68 loc) · 2.53 KB
/
Solution.java
File metadata and controls
96 lines (68 loc) · 2.53 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
package com.javarush.task.task12.task1228;
//Simon Peter said to him, "Lord, where are you going?" Jesus answered, "Where I am going, you can't follow now,
//but you will follow afterwards." (John 13:36)
/*
Интерфейсы к классу Human
*/
public class Solution {
public static void main(String[] args) {
Human human = new Human();
System.out.println(human);
}
public static interface Worker {
public void workLazy();
}
public static interface Businessman {
public void workHard();
}
public static interface Secretary {
public void workLazy();
}
public static interface Miner {
public void workVeryHard();
}
public static class Human implements Worker, Secretary, Businessman {
public void workHard() {
}
public void workLazy() {
}
}
}
/*
Интерфейсы к классу Human
Добавь как можно больше интерфейсов к классу Human, но чтобы он не стал абстрактным классом.
Добавлять методы в класс Human запрещается.
Требования:
1. Класс Solution должен содержать интерфейс Worker с методом void workLazy().
2. Класс Solution должен содержать интерфейс Businessman с методом void workHard().
3. Класс Solution должен содержать интерфейс Secretary с методом void workLazy().
4. Класс Solution должен содержать интерфейс Miner с методом void workVeryHard().
5. Класс Solution должен содержать класс Human с методами: void workHard() и void workLazy().
6. Класс Human должен реализовывать три интерфейса.
package com.javarush.task.task12.task1228;
Интерфейсы к классу Human
public class Solution {
public static void main(String[] args) {
Human human = new Human();
System.out.println(human);
}
public static interface Worker {
public void workLazy();
}
public static interface Businessman {
public void workHard();
}
public static interface Secretary {
public void workLazy();
}
public static interface Miner {
public void workVeryHard();
}
public static class Human {
public void workHard() {
}
public void workLazy() {
}
}
}
*/