Archive for December 17th, 2008
Java: static declaration of collection
December 17th, 2008
Filed under:
at 01:26pm
I don’t know if this is a new feature in Java 5 that I did not know before or I just did not know this is possible in Java. But I learned today that you can do static declaration of collection types as below:
public static List<String> supportedCopyPropertyTypes = new ArrayList<String>() {
private static final long serialVersionUID = 660145948432567403L;
{
add("String");
add("BigDecimal");
add("int");
}
};

