Resolve the conflict by only changing the code in NewLinePrinterInterface. The resulting code should print something else to the console.
Interface composition
Another conflicting interface
Report a typo
Write a program in Kotlin
interface PrinterInterface {
fun printSomething() = print("something")
fun printSomethingElse() = print("something else")
}
// Do not change the code above.
interface NewLinePrinterInterface {
// Change only the code here.
fun printSomething() = println("new line something")
fun printSomethingElse() = println("new line something else")
}
// Do not change the code below.
class MultiPrinterClass : PrinterInterface, NewLinePrinterInterface {
override fun printSomething() = print("classy something")
override fun printSomethingElse() {
super.printSomethingElse()
}
}
___
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.