14 lines
244 B
Kotlin
14 lines
244 B
Kotlin
interface Creator<T> {
|
|
fun create() : T
|
|
}
|
|
|
|
class Actor(val code: String = "OK")
|
|
|
|
interface Factory : Creator<Actor>
|
|
|
|
class MyFactory() : Factory {
|
|
override fun create(): Actor = Actor()
|
|
}
|
|
|
|
fun box() : String = MyFactory().create().code
|