Juan-Carlos Gandhi (
juan_gandhi) wrote2008-04-28 03:35 pm
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Java bashing
enum Color {
RED(0xff0000),
GREEN(0x00ff00),
BLUE(0x0000ff),
WHITE(0xffffff);
int code;
Color(int code) {
this.code = code;
}
public int getCode() {
return code;
}
}
//... (many files away)
Set<Color> myPalette = newHashSet(RED, WHITE, BLUE);
//... (many lines/files away)
if (myPalette.contains(0xff0000)) {
System.out.println("0xff0000 is our color!");
}