-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSolution.java
More file actions
60 lines (39 loc) · 1.42 KB
/
Solution.java
File metadata and controls
60 lines (39 loc) · 1.42 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
package com.javarush.task.task12.task1214;
//When Jesus had said this, he was troubled in spirit, and testified,
//"Most certainly I tell you that one of you will betray me." (John 13:21)
/*
Корова — тоже животное
*/
public class Solution {
public static void main(String[] args) {
}
public static abstract class Animal {
public abstract String getName();
}
public static class Cow extends Animal {
public String getName() {
return "God is Love";
}
}
}
/*
Корова — тоже животное
Унаследуй класс Cow от Animal.
Реализуй все недостающие методы в классе Cow.
Требования:
1. Класс Animal должен быть абстрактным.
2. Класс Cow не должен быть абстрактным.
3. Класс Cow должен наследоваться от класса Animal.
4. Класс Cow должен реализовать абстрактный метод из класса Animal.
5. Метод getName() класса Cow должен возвращать любое имя коровы.
package com.javarush.task.task12.task1214;
public class Solution {
public static void main(String[] args) {
}
public static abstract class Animal {
public abstract String getName();
}
public static class Cow {
}
}
*/