Working with IDE like NetBeans or IDEA, i've seen that they are converting generic types into this symbol:
private final List<String> ar = new ArrayList<~>();
But using this in a simple editor results in throwing an error. BTW Eclipse also doesn't like it. Is it somehow connected with type erasure mechanism?
You will see that in IntelliJ its a different colour!
This is because it has used code folding to hide the code, but you can't write it this way in Java 6.
In Java 7 you can write
private final List<String> ar = new ArrayList<>();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With