class Person {
private String name;
private Address address; // Address object stored privately
public Person(String name, Address address) {
this.name = name;
this.address = new address; // indirect assignment of the object I.e copy
}
public String getName() { //getter method for the name
return name;
}
public Address getAddress() { //getter method for the Address
return address;
}
}
#Friday #quiz