-
-
Save 5AbhishekSaxena/cab5fb585889448303f7680e374fa17b 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
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