Mapping: "redundant type arguments in new expression (use diamond operator instead)"
I am getting a notification on the line number in NetBeans saying "redundant type arguments in new expression (use diamond operator instead)".
I have only just learnt basic mapping theory and this is my first time using it. I have tested my code and the map actually appears to be working perfectly fine - no compilation errors, no runtime errors.
This is the line of code with the alert put on it.
Code:
HashMap<String, AtoCSeat> seatMap = new HashMap<String, AtoCSeat>();
Is there something wrong with it?
AtoCSeat is my own data type.
Re: Mapping: "redundant type arguments in new expression (use diamond operator instea
There is nothing wrong, the IDE is just suggesting you write it as
Code:
HashMap<String, AtoCSeat> seatMap = new HashMap<>();
See the Type Inference for Generic Instance Creation notes that come with the JDK 7 sdk.
Re: Mapping: "redundant type arguments in new expression (use diamond operator instea