Arrange the code lines in the correct order so that the code compiles without errors.
Computer scienceProgramming languagesKotlinObject-oriented programmingObject-oriented programming features
Object expressions
Arrange the lines
Report a typo
Reorder lines using drag or arrows. Adjust indentation with left buttons
val x = 10
}
}
val y = 20 + x
val anonymousObject = object {
fun printSum() {
println("Sum: ${x + y}")
___
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.