Last active
July 30, 2019 07:01
-
-
Save ch8n/f50d88cc3288ccbf618d4c356183fe0f to your computer and use it in GitHub Desktop.
Destructuring an object : Kotlin Way
This file contains hidden or 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
| //class | |
| data class Person(val name:String,val age:Int) | |
| //instantiate | |
| val developer = Person("Ch8n", 25) | |
| //access | |
| val (name,age) = developer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment