Possible Duplicate:
Double brace initialisation (anonymous inner class) with diamond operator
Using Java 7, why is the following a problem
final List<String> a = new ArrayList<>() {
{
add("word");
}
};
Explicit type declaration is needed as in
final List<String> a = new ArrayList<String>() {
{
add("word");
}
};