Created
May 6, 2020 21:19
-
-
Save hissain/e5f93ac70b39d83537f77cb09f032c71 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
data class Address( | |
var city: String? = null, | |
var post: String? = null) { | |
} | |
data class Student( | |
var name: String? = null, | |
var address: Address? = null) { | |
} | |
// Call | |
val student = Gson().fromJson<Student>(json, Student::class.java) | |
// student.address.city will be = "Rome" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment