ã¯ããã« Java ã® enum ã¯å¤§å¤ä¾¿å©ã§é常å¤ãã®ã·ã¼ã³ã§æ´»ç¨ããã¦ãã¾ããä¾ãã°åºåã表ããããªãªãã¸ã§ã¯ãã表ç¾ãããéã«ããã使ããã¦ãã¾ããã Java 14 ã§æ£å¼æ©è½ã¨ãªã£ã switchå¼ã«ã¦ç¶²ç¾ æ§æ¤æ»ãè¡ããããã«ãªããããã¾ã§ä»¥åã§ã¯ã©ããã¦ãæ½è±¡ã¡ã½ããçãæ´»ç¨ããå¿ è¦ããã£ãå¦çã«ã¤ãã¦ããswitchå¼ãå©ç¨ããäºã§ç°¡æ½ã«è¡¨ç¾ãããã¨ãã§ããããã«ãªãã¾ããã ã¾ããJava 17 ã§æ£å¼æ©è½ã¨ãªã£ã sealed classes/interfaces 㨠Java 21 ã§æ£å¼æ©è½ã«ãªã£ã Record Patterns ã«ãã£ã¦ãããã¾ã§å¿ è¦ã ã£ãåºåå¤ã®ãã㪠enum ãå¿ ãããå®ç¾©ããªãã¦è¯ãå ´åãåºã¦ãã¾ããã ãã®è¨äºã§ã¯ãä»ã¾ã§ enum ã使ã£ã¦ããã³ã¼ãããããã®æ©è½ã«ãã£ã¦ã©ã®ããã«å¤ããã®ããç´¹ä»ããç²ç®çã« enum ãå®ç¾©ããã®ã§ã¯
{{#tags}}- {{label}}
{{/tags}}