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
- Android
- 콜렉션
- 코틀린
- DART
- text
- List
- 다트
- variable
- animation
- ML
- function
- import
- 함수
- package
- set
- 웹크롤러
- 클래스
- map
- 파이썬
- pushnamed
- 플러터
- Flutter
- texttheme
- Class
- Collection
- kotlin
- python
- textstyle
- 크롤러
- crawler
Archives
- Today
- Total
목록제네릭 (1)
조용한 담장

코틀린 클래스의 제네릭(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