| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 | 31 |
- debugSymbolLevel
- 백준1476
- PreferenceManager
- dp
- 개수 세기
- 코틀린
- 백준3085
- 10430
- Counting The number
- 브루트포스
- 10807
- 25083
- 파이썬
- 2525
- 디버그심볼
- safari world
- kotlin
- Class Delegation
- 1330
- 백준
- Android
- BitMasking
- baekjoon
- 새싹
- 백준1107
- 18108
- 사파리 월드
- 꼬마 정민
- 10926
- 기본메신저
- Today
- Total
목록Kotlin (2)
세상을 더 좋게
간단한 코드를 일단 보자 interface Base { fun printX() } class BaseImpl(val x: Int) : Base { override fun printX() { print(x) } } interface를 통해 클래스에 필요한 프로토타입을 만들어 놓고 이를 BaseImpl이라는 클래스가 받아서 printX()를 제대로 구현하고 있다. interface Base { fun printX() } class BaseImpl(val x: Int) : Base { override fun printX() { print(x) } } class Derived(baseImpl: Base) 그렇다면 위와 같이 클래스 Derived가 BaseImpl의 구현된 메소드를 사용하려면 어떻게 해야할까? 인..
인터페이스는 클래스를 통해 구현된다. Example1. Runtime polymorphism 구현하기 open class Instrument { open fun play() { println("Instrument.play()") } } class Wind : Instrument() { override fun play() { println("Wind.play()") } } class Stringed : Instrument() { override fun play() { println("Stringed.play()") } } class Percussion : Instrument() { override fun play() { println("Percussion.play()") } } fun main() { v..