Hello, Delegate? Or are you Kotlin?

Report a typo

Complete the delegate object in the code below so that passing it as an implementation would print "Hello Delegate".

Sample Input 1:

Sample Output 1:

Hello Delegate
Write a program in Kotlin
// Do not change the code below!

interface IConsolePrinter {
val message: String
fun printMessage()
}

class BasicConsolePrinter(val x: String, val y: String) : IConsolePrinter {
override val message: String
get() = "$x $y"

override fun printMessage() {
print("Hello Kotlin")
}
}

class DerivedConsolePrinter(base: IConsolePrinter) : IConsolePrinter by base {
override fun printMessage() {
print(message)
}
}

fun main() {
val h = "Hello"
val d = "Delegate"
val k = "Kotlin"

// Do not change the code above!

val delegate = //?

// Do not change the code below!

val printer = DerivedConsolePrinter(delegate)
printer.printMessage()
}
___

Create a free account to access the full topic