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 | 31 |
Tags
- variable
- set
- List
- animation
- textstyle
- map
- python
- pushnamed
- 파이썬
- DART
- 클래스
- text
- 다트
- Collection
- package
- 크롤러
- Android
- 코틀린
- Flutter
- 웹크롤러
- 플러터
- crawler
- kotlin
- Class
- function
- import
- 콜렉션
- Yocto
- 함수
- ML
Archives
- Today
- Total
목록Generic (1)
조용한 담장
코틀린(Kotlin) 클래스(Class) : 제네릭(Generics)
코틀린 클래스의 제네릭(generic) 에 대해 알아보자. 원문 https://kotlinlang.org/docs/reference/generics.html 을 보며 정리. 코틀린의 제네릭 클래스: class Box(t: T) { var value = t } T 는 type parameter 이다. 클래스의 인스턴스를 생성할 때 type argument 를 제공해야 한다. val box: Box = Box(1) 생성자의 인자 값을 통해서나 다른 어떤 방식이든 parameter 의 타입이 추론이 가능할 때는 type argument 의 생략이 가능하다. val box = Box(1) // 1 has type Int, so the compiler figures out that we are talking ab..
kotlin
2020. 1. 2. 15:43