Skip to content

Instantly share code, notes, and snippets.

@5AbhishekSaxena
Created June 5, 2023 09:09
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/cab5fb585889448303f7680e374fa17b to your computer and use it in GitHub Desktop.
Save 5AbhishekSaxena/cab5fb585889448303f7680e374fa17b to your computer and use it in GitHub Desktop.
fun main() {
val address = getAddress()
val contact = getContact()
val company = getCompany()
val educations = getEducations()
val user = User()
user.setFirstName("Abhishek")
user.setLastName("Saxena")
user.setAddress(address)
user.setEducations(educations)
// OR
val user1 = User().apply {
setFirstName("Abhishek")
setLastName("Saxena")
setAddress(address)
setContact(contact)
setEducations(educations)
}
val user2 = User().apply {
setFirstName("Abhishek")
setLastName("Saxena")
setAddress(address)
setCompany(company)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment