I have a question concerning some semantics when instantiating a Map. Specifically, should I use the Wrapper class when assigning the key and value type, or is it okay to use primitive types?
Example:
Map<int, String> map = new TreeMap<int, String>();
OR
Map<Integer, String> map = new TreeMap<Integer, String>();
Example:
Map<int[], String> map = new TreeMap<int[], String>();
OR
Map<Integer[], String> map = new TreeMap<Integer[], String>();
Is there any difference between the two instantiations, in terms of both convention and meaning? I know using primitive types invokes Autoboxing when the object is read or written to.