Last active
April 5, 2019 06:06
-
-
Save akshanshjain95/6450e16c8545d562fa60e2fb23f95f7d to your computer and use it in GitHub Desktop.
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
public final class Person { | |
//required fields | |
private final String firstName; | |
private final String lastName; | |
//optional fields | |
private final String middleName; | |
private final String facebookId; | |
private final String twitterId; | |
public Person(String firstName, String lastName, String middleName, String facebookId, String twitterId) { | |
this.firstName = firstName; | |
this.lastName = lastName; | |
this.middleName = middleName; | |
this.facebookId = facebookId; | |
this.twitterId = twitterId; | |
} | |
public Person(String firstName, String lastName, String middleName, String facebookId) { | |
this(firstName, lastName, middleName, facebookId, ""); | |
} | |
public Person(String firstName, String lastName, String middleName) { | |
this(firstName, lastName, middleName, ""); | |
} | |
public Person(String firstName, String lastName) { | |
this(firstName, lastName, ""); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment