The following code is used for serializing a Person class instance and then printing the JSON string. Put the lines in the correct order.
Kotlinx serialization
Encoding: correct order
Report a typo
Put the items in the correct order
val json = Json.encodeToString(person)
@Serializable
val person = Person("John Doe", 29)
class Person(val name: String, val age: Int)
println(json)
___
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.