adk
03/12/2020, 9:30 AMval myInterfaceObject = InterfaceImplementation()
class InterfaceImplementation: SomeInterface {
override fun displayInfo() {
println("Hello from the displayInfo")
}
override fun dispayMoreContent() {
print("This is more content")
}
override val myName: String
get() = "value"
}
interface SomeInterface {
fun displayInfo()
fun dispayMoreContent()
val myName: String
}
println("My Variable value is ${myInterfaceObject.myName}")
println("Call the displayInfo ${myInterfaceObject.displayInfo()}")
println("Call the interface method ${myInterfaceObject.dispayMoreContent()}")
When it should look something like this:
val myInterfaceObject = InterfaceImplementation()
class InterfaceImplementation: SomeInterface {
override fun displayInfo(): String {
return "Hello from the displayInfo"
}
override fun dispayMoreContent(): String {
return "This is more content"
}
override val myName: String
get() = "value"
}
interface SomeInterface {
fun displayInfo(): String
fun dispayMoreContent(): String
val myName: String
}
println("My Variable value is ${myInterfaceObject.myName}")
println("Call the displayInfo ${myInterfaceObject.displayInfo()}")
println("Call the interface method ${myInterfaceObject.dispayMoreContent()}")