Look at the code below. Someone made mistakes when writing it. Correct the errors in the code to make it work.
Argument naming in overridden functions
Moving around
Report a typo
Write a program in Kotlin
class Vehicle {
fun move(speed: Int, direction: String) {
println("Moving at $speed km/h towards $direction")
}
}
class Car : Vehicle() {
override fun move(speed: Int, direction: String) {
println("Driving at $speed km/h towards $direction")
}
}
___
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.