Could someone please tell me why the code below will results in a compile time error without casting? Much appreciate your help.
List list = new ArrayList();
list.add("hello");
String s = (String) list.get(0);
Could someone please tell me why the code below will results in a compile time error without casting? Much appreciate your help.
List list = new ArrayList();
list.add("hello");
String s = (String) list.get(0);