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!!
Maybe is a newbie question, but I don’t understand why when I try to
Share
Simply put: Java generics don’t work with primitive type arguments, only classes. So in the same way, you can’t use
List<int>, onlyList<Integer>.See the relevant Java Generics FAQ entry for more information.