1. For generics, does it mean we define the <Type> during declaration so it makes our life easier?
i.e List<String> ls = new ArrayList<String>;
so the above, the list can only contain String objects and no other types?
this <type> can only be used on collections and arrays?
1a. What is the use of Collection<object> and Collection<?>
2. I'm having issues understanding Autoboxing. I read http://java.sun.com/j2se/1.5.0/docs/guide/language/autoboxing.html
, still aint sure what its doing and what its for? Is it trying to say Autoboxing is automatic now.. and it is no problem if we do:
int x = 5;
Integer y = x;
int z = y;