Maybe is a newbie question, but I don't understand why when I try to do something like Map<String, boolean>
my IDE screams saying "Syntax error on token "boolean", Dimensions expected after this token", but with Boolean it works perfect. Can anyone explain me why is it like that? Thanks in advance!!
Simply put: Java generics don't work with primitive type arguments, only classes. So in the same way, you can't use List<int>
, only List<Integer>
.
See the relevant Java Generics FAQ entry for more information.
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