Created
May 6, 2020 21:17
-
-
Save hissain/7b920af677da4471d3a2fcddc66484d7 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 Student( | |
@SerializedName("key_name") | |
var name: String? = null, | |
@SerializedName("key_address") | |
var address: String? = null) { | |
} | |
val student = Student("Mark", "London, 12000") // object | |
val json = Gson().toJson(student) // json string | |
/** Output json will be like below **/ | |
{ | |
"key_name": "Mark", | |
"key_address": "London, 12000" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment