1public class Person {
2 private String name;
3 private int age;
4
5 public Person(String initialName) {
6 this.name = initialName;
7 this.age = 0;
8 }
9
10 public void printPerson() {
11 System.out.println(this.name + ", age " + this.age + " years");
12 }
13
14 public String getName() {
15 return this.name;
16 }
17}