We created a class with a private property and function. We implemented a function that allows you to access these private elements within the class.
Something happened and all the lines were mixed up. Arrange the lines of code in the correct order.
Computer scienceProgramming languagesKotlinObject-oriented programmingObject-oriented programming basic
Visibility for classes, packages, and modules
Mixed up code lines
Report a typo
Reorder lines using drag or arrows. Adjust indentation with left buttons
privateTaskFunction()
class PrivateTask {
}
println("Private function")
}
}
println(privateTaskProperty)
fun showPrivateElements() {
private val privateTaskProperty: String = "Private property"
private fun privateTaskFunction() {
___
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.