Skip to content

Instantly share code, notes, and snippets.

@5AbhishekSaxena
Created June 5, 2023 09:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 5AbhishekSaxena/0daafe311e448cd1e0e88f85f98e27ae to your computer and use it in GitHub Desktop.
Save 5AbhishekSaxena/0daafe311e448cd1e0e88f85f98e27ae to your computer and use it in GitHub Desktop.
class User {
private val firstName: String
private val lastName: String
private val address: Address
private val educations: List<Education>
constructor(
firstName: String,
lastName: String,
address: Address,
educations: List<Education>
) {
this.firstName = firstName
this.lastName = lastName
this.address = address
this.educations = educations
}
constructor(
firstName: String,
middleName: String,
lastName: String,
address: Address,
educations: List<Education>
) {
this.firstName = firstName
this.middleName = middleName
this.lastName = lastName
this.address = address
this.educations = educations
}
constructor(
firstName: String,
middleName: String,
lastName: String,
address: Address,
company: Company?,
educations: List<Education>
) {
this.firstName = firstName
this.middleName = middleName
this.lastName = lastName
this.address = address
this.company = company
this.educations = educations
}
constructor(
firstName: String,
lastName: String,
address: Address,
contact: Contact?,
educations: List<Education>
) {
this.firstName = firstName
this.lastName = lastName
this.address = address
this.contact = contact
this.educations = educations
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment