Departing from traditional practice for JavaWorldโ€™s Tips โ€˜N Tricks column, I will talk about when not to use a previously suggested trick. Specifically, the typesafe enum construct, covered in JDC ...
่ฆ‹ใฆๅˆ†ใ‹ใ‚‹้€šใ‚Šใ€ๅฎฃ่จ€ใซๅˆฉ็”จใ•ใ‚Œใฆใ„ใ‚‹ใ‚ญใƒผใƒฏใƒผใƒ‰ใฏ enum ใงใ€class ใงใฏใชใ„ใ€‚ ใคใพใ‚Šใ€Enum ใฏใ‚ฏใƒฉใ‚นใงใฏใชใ„ใ€‚ ใ‚ˆใ†ใซ่ฆ‹ใˆใ‚‹ใŒใ€Java ใฎๅ†…้ƒจ็š„ใซใฏ enum ใฏใ€ๆŠฝ่ฑกใ‚ฏใƒฉใ‚น Enum ใ‚’็ถ™ๆ‰ฟ๏ผˆextends๏ผ‰ใ—ใŸใ‚ฏใƒฉใ‚นใงใ‚ใ‚‹ใ€‚
Although it is part of the java.util.concurrent package, the TimeUnit enum is useful in many contexts outside of concurrency. In this post, I look at how the TimeUnit enum can be used even in code ...