Computer scienceProgramming languagesKotlinObject-oriented programmingObject-oriented programming usage

Packages and imports

Identical class

Report a typo

In the following code, you have the same class name in two packages. Write how you would solve this situation according to the example shown.

import packageone.Car
import packagetwo.Car

fun main(args: Array<String>) {
    val carOne = Car(1988, "Ford")
    println(carOne)
    val carTwo = AdvancedCar("Ford", "Turbo", 1978)
    println(carTwo)
}
Enter a short text
___

Create a free account to access the full topic