Kotlin
interface IBook
{
fun Display();
}
fun main() {
val book1 = object : IBook
{
override fun Display () { println("Book: Wizard of the Mediterranean") }
}
book1.Display()
}
Explanation:
Made an unnamed class that inherits from
IBook:
Kotlin
val book1 = object : IBook
{
override fun Display () { println("Book: Wizard of the Mediterranean") }
}