why use generic in real life
List<String> list = new ArrayList<String>();
list.add("hello");
String s = list.get(0); // no cast
4.4
5
List list = new ArrayList();
list.add("hello");
String s = (String) list.get(0);
Thank you!
5
0
Are there any code examples left?
New code examples in category Other