Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- List
- Flutter
- 웹크롤러
- 클래스
- 크롤러
- kotlin
- textstyle
- crawler
- map
- Android
- DART
- Collection
- function
- texttheme
- Class
- 다트
- ML
- 콜렉션
- set
- python
- variable
- pushnamed
- 파이썬
- package
- 코틀린
- import
- animation
- 함수
- 플러터
- text
Archives
- Today
- Total
목록Delegation (1)
조용한 담장

코틀린(kotlin) 클래스의 위임(delegation) 을 살펴보자. 원문 https://kotlinlang.org/docs/reference/delegation.html 을 보며 정리. Implementation by Delegation kotlin 은 상속의 대안이 되는 Delegation pattern 을 boilerplate code 없이 지원한다. 아래 예제에서, Derived 클래스는 자신의 모든 public 멤버들을 특정 오브젝트(BaseImpl)로 위임하여 Base 인터페이스를 구현할 수 있다. interface Base { fun print() } class BaseImpl(val x: Int) : Base { override fun print() { print(x) } } class ..
kotlin
2020. 1. 2. 16:34