The following code is used for decoding a JSON string into a Person class instance. Put the lines in the correct order.
Kotlinx serialization
Decoding: correct order
Report a typo
Put the items in the correct order
val person = Json.decodeFromString<Person>("""{"name":"John Doe","age":29}""")
@Serializable
println(person)
data class Person(val name: String, val age: Int)
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.