ã¯ããã« ä»æ¥èªãã ã¨ãã 143 ãã¼ã¸ã 159 ãã¼ã¸ ååã¯ãã¡ã Effective Java èªæ¸ä¼ 7 æ¥ç® ãPECS! PECS! PECS!ã - ITæ¦è¨ int å®æ°ã¨ã使ããªã åå®å ¨ãããªããã enum 使ã enum Hoge { FOO, BAR; } ç°¡å ã¡ã½ãããæã¦ã enum Hoge { FOO, BAR; void a() { /* (snip) */ } } ã§ã以ä¸ã®ããã«ä½¿ã Hoge.FOO.a(); ã·ã³ã°ã«ãã³ã æè¿ã® Java ã§ã¯ enum ã§ãããããï¼ switch æã®ä»£ããã«åºæã¡ã½ãã enum Hoge { FOO { void a() { /*snip*/ } }, BAR { void a() { /*snip*/ } }; abstract void a(); } 以ä¸ã®ã³ã¼ãã // ããã¯ãã¡ swit
{{#tags}}- {{label}}
{{/tags}}