Search   Feed   Browse   Add
Feed items 1 - 1 of 1 for July 2007

More with Java enums: simulating inheritance - July 9, 2007

One drawback to the Java enum is the lack of inheritance. Java uses inheritance for many reasons, one of which is implementation inheritance. (In C++ you would use private inheritance for the same reason.) To recapture implementation inheritance with enums, use the visitor pattern: class Convert public interface Vivid char character(); public static <E extends Enum<E> & Vivid> E from( E values, char character) for (E e : values) .
http://binkley.blogspot.com/2007/07/more-with-java-enums-simulating.html
Available Archives
- May (1 item)
- June (3 items)
- July (1 item)
- August (3 items)
- September (1 item)
- October (6 items)
- November (5 items)
Sponsored Links
© 2008 FeedCapsule.com  |  Contact