Skip to content

Commit 61e49c6

Browse files
authored
you will follow
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)
1 parent 2d1295a commit 61e49c6

1 file changed

Lines changed: 96 additions & 0 deletions

File tree

‎task12/task1228/Solution.java‎

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
package com.javarush.task.task12.task1228;
2+
3+
//Simon Peter said to him, "Lord, where are you going?" Jesus answered, "Where I am going, you can't follow now,
4+
//but you will follow afterwards." (John 13:36)
5+
6+
/*
7+
Интерфейсы к классу Human
8+
*/
9+
10+
public class Solution {
11+
public static void main(String[] args) {
12+
Human human = new Human();
13+
System.out.println(human);
14+
}
15+
16+
public static interface Worker {
17+
public void workLazy();
18+
}
19+
20+
public static interface Businessman {
21+
public void workHard();
22+
}
23+
24+
public static interface Secretary {
25+
public void workLazy();
26+
}
27+
28+
public static interface Miner {
29+
public void workVeryHard();
30+
}
31+
32+
public static class Human implements Worker, Secretary, Businessman {
33+
34+
public void workHard() {
35+
}
36+
37+
public void workLazy() {
38+
}
39+
}
40+
}
41+
42+
43+
44+
/*
45+
Интерфейсы к классу Human
46+
Добавь как можно больше интерфейсов к классу Human, но чтобы он не стал абстрактным классом.
47+
Добавлять методы в класс Human запрещается.
48+
49+
50+
Требования:
51+
1. Класс Solution должен содержать интерфейс Worker с методом void workLazy().
52+
2. Класс Solution должен содержать интерфейс Businessman с методом void workHard().
53+
3. Класс Solution должен содержать интерфейс Secretary с методом void workLazy().
54+
4. Класс Solution должен содержать интерфейс Miner с методом void workVeryHard().
55+
5. Класс Solution должен содержать класс Human с методами: void workHard() и void workLazy().
56+
6. Класс Human должен реализовывать три интерфейса.
57+
58+
package com.javarush.task.task12.task1228;
59+
60+
61+
Интерфейсы к классу Human
62+
63+
64+
public class Solution {
65+
public static void main(String[] args) {
66+
Human human = new Human();
67+
System.out.println(human);
68+
}
69+
70+
public static interface Worker {
71+
public void workLazy();
72+
}
73+
74+
public static interface Businessman {
75+
public void workHard();
76+
}
77+
78+
public static interface Secretary {
79+
public void workLazy();
80+
}
81+
82+
public static interface Miner {
83+
public void workVeryHard();
84+
}
85+
86+
public static class Human {
87+
88+
public void workHard() {
89+
}
90+
91+
public void workLazy() {
92+
}
93+
}
94+
}
95+
96+
*/

0 commit comments

Comments
 (0)