2024-06-21

This commit is contained in:
2024-06-21 15:01:25 +09:00
commit b5f6bbb1e0
41 changed files with 1895 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
# 위임
```kotlin
interface Base {
fun print()
}
class BaseImpl(val x: Int) : Base {
override fun print() { print(x) }
}
class Derived(b: Base) : Base by b
fun main(){
val b = BaseImpl(10)
Derived(b).print()
}
```