I'm reading about Java Generics. and I want to ask what is the difference between the following statements.
1: List<String> list = new ArrayList(3);
2: List<String> list = new ArrayList<String>(2);
3: List<String> list = new ArrayList<String>();
4a: List<String> list = new ArrayList("A"); // why I can't use String?
4b: List<String> list = new ArrayList('a'); // but char works fine.
I'm reading Java Docs on Generics and after that I need to ask the above questions because I didn't get exact answer.(May be due to poor English)
charisn't working fine, it is being treated as anint. a good place to start is reading the javadoc for ArrayList.