forked from igortereshchenko/Java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWorker.java
More file actions
48 lines (29 loc) · 921 Bytes
/
Worker.java
File metadata and controls
48 lines (29 loc) · 921 Bytes
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
package Person;
import Person.IWorker.IPorfolio;
/**
* Created by student on 22.03.2018.
*/
public final class Worker extends Person implements IPorfolio{
public Worker(String name, int age, int height, int weight, String passportNumber) {
super(name, age,height,weight,passportNumber); //Constructor(...):base(...)
}
public String getPersonInfo(){
String result = "Worker:\n"+super.getPersonInfo();
return result;
}
public void printWorkerInfo() {
System.out.println(this.getPersonInfo()+" "+this.passport.getPassportInfo());
}
public Human getBiometricInfo() {
return new Human(this.height,this.weight) {
public int getWeight() {
return this.weight;
}
};
}
/*
public String baseClassInfo(){
return "Person is NOT :) base class";
}
*/
}