Java program runs fine but doesn't compile
collections, compiler-errors, hashmap, java
Solution
You are placing your type parameters in wrong place. It comes in between `HashMap` and the `()`: -
config1 = new HashMap<String,ArrayList<HashMap<String,String>>>();
Also, its a good idea to have more generalized types rather than specific types in the declaration, and even in `generic type parameters`. So you should use `Map` instead of `HashMap` in declaration, and `List` instead of `ArrayList` in your `type parameter`: -
And actually, you don't need to break your declaration and initialization in two lines. Just have them in one single line. It looks more cleaner. So, you can change your two lines to: -
protected Map<String, List<Map<String,String>>> config1 =
new HashMap<String, List<Map<String,String>>>();
Problem
I have a java program which runs properly. But when I try to clean and build it in Netbeans it is choking on this line: ``` protected HashMap<String, ArrayList<HashMap<String,String>>> config1 config1 = new <String,ArrayList<HashMap<String,String>>> HashMap(); // build breaks here. ``` the error is: ``` cannot find symbol symbol : constructor <java.lang.String,java.util.ArrayList<java.util.HashMap<java.lang.String,java.lang.String>> >HashMap() ```