Encoding: correct order

Report a typo

The following code is used for serializing a Person class instance and then printing the JSON string. Put the lines in the correct order.

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)
___

Create a free account to access the full topic