Fixed fields for example
@@ -29,6 +29,10 @@ class Address {
this.title = title;
}
+ public String getTitle() {
+ return title;
+ }
+
@Override
public String toString() {
return "Address{title='" + title + '\'' + '}';
@@ -46,6 +50,18 @@ class Contact {
this.address = address;
}
+ public String getName() {
+ return name;
+ }
+
+ public int getAge() {
+ return age;
+ }
+
+ public Address getAddress() {
+ return address;
+ }
+
@Override
public String toString() {
return "Contact{name='" + name + '\'' + ", age=" + age + ", address=" + address + '}';
