/** * Effective Java 第二版 * 第30条:用enum代替int常量 */ import java.util.HashMap;import java.util.Map; public class EnumTest { /*媒体操作*/ public final static int START = 1; public final static int PAUSE = 2; public final static int RESUME = 3; public final sta…
Enumerated type is a type whose legal values consist of a fixed set of constants, such as the seasons of the year. // The int enum pattern - severely deficient! public static final int APPLE_FUJI = 0; public static final int APPLE_PIPPIN = 1; public…
Hi guys, I am happy to tell you that I am moving to the open source world. And Java is the 1st language I have chosen for this migration. It's a nice chance to read some great books like "Effective Java 2nd Edition" and share the note for what I…