6
6
* @author Yuriy Salimov ([email protected] )
7
7
* @version 1.0
8
8
*/
9
- public class Human implements Cloneable , Serializable {
9
+ public final class Human implements Cloneable , Serializable {
10
10
11
11
private static final long serialVersionUID = 1L ;
12
12
private String name ;
@@ -22,7 +22,10 @@ public Human() {
22
22
this .weight = 70 ;
23
23
}
24
24
25
- public Human (String name , String surname , String birth , String sex ) {
25
+ public Human (
26
+ final String name , final String surname ,
27
+ final String birth , final String sex
28
+ ) {
26
29
this ();
27
30
this .name = name ;
28
31
this .surname = surname ;
@@ -38,18 +41,18 @@ public Human clone() throws CloneNotSupportedException {
38
41
@ Override
39
42
public String toString () {
40
43
return "Human{" +
41
- "name='" + name + '\'' +
42
- ", surname='" + surname + '\'' +
43
- ", birth='" + birth + '\'' +
44
- ", sex='" + sex + '\'' +
45
- ", profession='" + profession + '\'' +
46
- ", height=" + height +
47
- ", weight=" + weight +
44
+ "name='" + this . name + '\'' +
45
+ ", surname='" + this . surname + '\'' +
46
+ ", birth='" + this . birth + '\'' +
47
+ ", sex='" + this . sex + '\'' +
48
+ ", profession='" + this . profession + '\'' +
49
+ ", height=" + this . height +
50
+ ", weight=" + this . weight +
48
51
'}' ;
49
52
}
50
53
51
54
@ Override
52
- public boolean equals (Object object ) {
55
+ public boolean equals (final Object object ) {
53
56
if (this == object ) {
54
57
return true ;
55
58
}
@@ -83,47 +86,47 @@ public String getName() {
83
86
return this .name ;
84
87
}
85
88
86
- public void setName (String name ) {
89
+ public void setName (final String name ) {
87
90
this .name = name ;
88
91
}
89
92
90
93
public String getSurname () {
91
94
return this .surname ;
92
95
}
93
96
94
- public void setSurname (String surname ) {
97
+ public void setSurname (final String surname ) {
95
98
this .surname = surname ;
96
99
}
97
100
98
101
public String getBirth () {
99
102
return this .birth ;
100
103
}
101
104
102
- public void setBirth (String birth ) {
105
+ public void setBirth (final String birth ) {
103
106
this .birth = birth ;
104
107
}
105
108
106
109
public String getSex () {
107
110
return this .sex ;
108
111
}
109
112
110
- public void setSex (String sex ) {
113
+ public void setSex (final String sex ) {
111
114
this .sex = sex ;
112
115
}
113
116
114
117
public String getProfession () {
115
118
return this .profession ;
116
119
}
117
120
118
- public void setProfession (String profession ) {
121
+ public void setProfession (final String profession ) {
119
122
this .profession = profession ;
120
123
}
121
124
122
125
public int getHeight () {
123
126
return this .height ;
124
127
}
125
128
126
- public void setHeight (int height ) {
129
+ public void setHeight (final int height ) {
127
130
this .height = height ;
128
131
}
129
132
0 commit comments