Language/Java

Enum 활용하여 구조 갖추기

fabxoe 2021. 9. 29. 15:34

검색 키워드: Enum base method(https://www.google.com/search?sxsrf=AOaemvJL4g6548VoU6uBLDbatDr6DfUr4g:1632889481331&q=Enum+base+method+java&sa=X&ved=2ahUKEwilv_erq6PzAhUYBN4KHdJRC2sQ1QJ6BAgxEAE&biw=1941&bih=1068&dpr=1)

검색된 링크

비고

  • Enum cannot either extend or be extended,
  • Mirror Enum(Enumus library)
  • EnumSet과 EnumMap?
  • It is not always possible to implement method in enum itself because the enum may belong to a third-party library or another team in the company
  • all enum types in Java are singleton by default.
  • concrete methods in enum, abstract methods in enum, enum inheritance. 
  • EnumSet과 EnumMap
  • Enums cannot extend anything because enums automagically extend class Enum.
  • But Enum can implement methods.
  • Enum cannot either extend or be extended
    • Emulate Extensible Enums With Interfaces
    • Emulate Extending the Constants
    • Extending an Enum Without Changing the Code