본문 바로가기

조용한 담장

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

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

목록Sealed (1)

조용한 담장

코틀린(Kotlin) 클래스(Class) : Sealed Classes

코틀린의 sealed class 에 대해 살펴보자. 원문 https://kotlinlang.org/docs/reference/sealed-classes.html 을 보며 정리. 제한된 타입들의 집합에 속한 값만을 가질 수 있는 Enum 처럼 제한된 클래스 계층 구조를 나타내는 데 사용된다. sealed class 는 일종의 Enum class 의 확장(extension) 이다. Enum class 는 enum type 에 속하는 값들이 제한되지만 각 enum constant 는 유일한 단독 인스턴스로 존재한다. 반면에 sealed class 의 subclass 는 여러개의 인스턴스를 가질 수 있고 state 를 가질수 있다. sealed modifier 를 통해 선언한다. subclass 를 가질 수 있..

kotlin 2019. 12. 31. 18:29
Prev 1 Next

Blog is powered by kakao / Designed by Tistory

티스토리툴바