Moving around

Report a typo

Look at the code below. Someone made mistakes when writing it. Correct the errors in the code to make it work.

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

Create a free account to access the full topic