Thanks, Shiv
SCJP, OCE - JSP & Servlets Developer
SCJP 1.5
Dolphins are grey, but they dream in colour.
public class TestwildCards{
public static void main(String arg[]){
List<Integer> mylist=new ArrayList<Integer>();
Bar bar=new Bar();
bar.doInsert(mylist);
}
}
class Bar{
void doInsert(List<Object> list){
list.add(new Dog());
}
}
It is mentioned as this code listing compiles fine.
cmbhatt
Thanks, Shiv
SCJP, OCE - JSP & Servlets Developer
Thanks, Shiv
SCJP, OCE - JSP & Servlets Developer
Thanks, Shiv
SCJP, OCE - JSP & Servlets Developer
Thanks, Shiv
SCJP, OCE - JSP & Servlets Developer
Also what is the difference does it make between List<?> and List<object> ???
cmbhatt
Thanks, Shiv
SCJP, OCE - JSP & Servlets Developer