티스토리 뷰
728x90
A sealed class is "an extension of enum classes". They can exist in multiple instances that contain state while each enum constant exists only as a single instance.
Since, in your example, you don't need the values to be instantiated multiple times and they don't provide special behavior, enums should just be right for the use case.
https://stackoverflow.com/questions/49169086/sealed-class-vs-enum-when-using-associated-type
sealed class vs enum when using associated type
I'd like to create a color object based on an Int. I can achieve the same result using sealed class and enum and was wondering if one is better than the other. Using sealed class: sealed class
stackoverflow.com
728x90
'공부' 카테고리의 다른 글
[python][pandas] df.groupby('a').agg({'b':lambda x: list(x)}) (0) | 2022.08.06 |
---|---|
[MacOSX] ISO8601 (0) | 2022.08.06 |
trunk based development (0) | 2022.08.06 |
[Python] for idx, x in enumerate(list): print(idx, x); index, value (0) | 2022.08.06 |
[logback-spring.xml] get `application.yaml` (0) | 2022.08.06 |
댓글
250x250
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- COUNT
- 테슬라 레퍼럴 코드 확인
- 클루지
- 테슬라 크레딧 사용
- 팔로워 수 세기
- 테슬라
- 테슬라 리퍼럴 코드 생성
- 모델y
- 테슬라 레퍼럴 적용 확인
- 책그림
- 메디파크 내과 전문의 의학박사 김영수
- 모델 Y 레퍼럴
- 김달
- 테슬라 리퍼럴 코드
- 테슬라 리퍼럴 코드 혜택
- wlw
- 개리마커스
- Bot
- 테슬라 레퍼럴
- follower
- 레퍼럴
- Kluge
- 테슬라 추천
- 인스타그램
- 어떻게 능력을 보여줄 것인가?
- 할인
- 연애학개론
- 유투브
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함