-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPensioner.java
More file actions
51 lines (33 loc) · 1.15 KB
/
Pensioner.java
File metadata and controls
51 lines (33 loc) · 1.15 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
public class Pensioner extends Person{
private double pension;
public Pensioner(String name, int age, int height, double weight , double pension){
super(name,age,height, (int) weight);
this.pension = pension;
}
@Override
public void die (){
System.out.println( "и , что-то произошло ...");
super.die();
System.out.println( "Ага, вот так и случилось!");
int countOfChildren = 0;
if ( getChildren() != null){
countOfChildren = getChildren().size();
}
System.out.println( "Зато у меня "+ countOfChildren + "Детей");
}
// public void die(){double x = (getAge() -50)*pension;
// System.out.println("Этот пенсионер умер, он заработал: ");
// }
public void abc ( int a ){
System.out.println( a);
}
public int getAge() {
return 0;
}
public double getPension() {
return pension;
}
public void setPension(double pension) {
this.pension = pension;
}
}