본문 바로가기

조용한 담장

검색하기
조용한 담장
프로필사진 iosroid

  • 분류 전체보기 (128)
    • Flutter (43)
    • tips (10)
    • Dart (14)
    • Interesthing (6)
    • python (6)
    • kotlin (40)
    • Blogs I read this week (3)
    • Yocto (1)
    • Rust (3)
Guestbook
Notice
Recent Posts
Recent Comments
Link
«   2026/02   »
일 월 화 수 목 금 토
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
Tags
  • Collection
  • 웹크롤러
  • set
  • python
  • map
  • Android
  • 함수
  • ML
  • pushnamed
  • 콜렉션
  • 클래스
  • 코틀린
  • 파이썬
  • textstyle
  • package
  • Flutter
  • import
  • kotlin
  • List
  • 크롤러
  • 플러터
  • 다트
  • Class
  • text
  • animation
  • variable
  • DART
  • rust
  • function
  • crawler
more
Archives
Today
Total
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록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
Prev 1 Next

Blog is powered by kakao / Designed by Tistory

티스토리툴바