Pure Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package eu.lockup.tests; | |
public class Person { | |
private final String firstName; | |
private final String lastName; | |
private final int age; | |
private final Address address; | |
private String hobby; | |
public Person(String firstName, String lastName, int age, Address address) { | |
this.firstName = firstName; | |
this.lastName = lastName; | |
this.age = age; | |
this.address = address; | |
} | |
public Person(String firstName, String lastName, int age, Address address, String hobby) { | |
this.firstName = firstName; | |
this.lastName = lastName; | |
this.age = age; | |
this.address = address; | |
this.hobby = hobby; | |
} | |
public String getFirstName() { | |
return firstName; | |
} | |
public String getLastName() { | |
return lastName; | |
} | |
public int getAge() { | |
return age; | |
} | |
public Address getAddress() { | |
return address; | |
} | |
public String getHobby() { | |
return hobby; | |
} | |
public void setHobby(String hobby) { | |
this.hobby = hobby; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment