blob: 4ed517cb0cc4c418d269703a33baf8a1b2fdb1e4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
public class Person {
protected String name;
protected String gender;
protected short age;
public Person(String name, String gender, short age) {
this.name = name.equals("Victor") ? "Viktor" : name;
this.gender = gender;
this.age = age;
}
public String toString() {
return String.format("%s[gen: %s, age: %d]", name, gender, age);
}
}
|