Skip to content

Commit 5ca3a46

Browse files
committed
task2909. Рефакторинг 3
1 parent 6b5e0eb commit 5ca3a46

File tree

3 files changed

+12
-22
lines changed

3 files changed

+12
-22
lines changed

3.JavaMultithreading/src/com/javarush/task/task29/task2909/human/Human.java

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@
44
import java.util.Collections;
55
import java.util.List;
66

7-
public class Human {
7+
public class Human implements Alive{
88
public static int nextId = 0;
99
private int id;
1010
protected int age;
1111
protected String name;
12-
protected int course;
1312

1413
protected int[] size;
1514

@@ -50,9 +49,6 @@ public void setName(String name) {
5049
this.name = name;
5150
}
5251

53-
public int getCourse() {
54-
return course;
55-
}
5652

5753
public List<Human> getChildren() {
5854
return Collections.unmodifiableList(children);
@@ -77,11 +73,6 @@ public Human(String name, int age) {
7773
this.name = name;
7874
}
7975

80-
public void live() {
81-
// if (isSoldier)
82-
// fight();
83-
}
84-
8576
public int getId() {
8677
return id;
8778
}
@@ -93,4 +84,9 @@ public void setId(int id) {
9384
public void printSize() {
9485
System.out.println("Рост: " + size[0] + " Вес: " + size[1]);
9586
}
87+
88+
@Override
89+
public void live() {
90+
91+
}
9692
}

3.JavaMultithreading/src/com/javarush/task/task29/task2909/human/Professor.java

Lines changed: 0 additions & 12 deletions
This file was deleted.

3.JavaMultithreading/src/com/javarush/task/task29/task2909/human/Student.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ public class Student extends Human {
88
private String university;
99
private Date beginningOfSession;
1010
private Date endOfSession;
11+
private int course;
1112

1213
public Student(String name, int age, double averageGrade) {
1314
super(name, age);
@@ -68,4 +69,9 @@ public double getAverageGrade() {
6869

6970
public void fight() {
7071
}
72+
73+
public int getCourse() {
74+
return course;
75+
}
76+
7177
}

0 commit comments

Comments
 (0)