public void addAnimal(List super Dog> animals) { animals.add(new Dog()); } it's NOT legal to add when we use Wildcard character >.(True/ False)
True
False
List l = new Arraylist(); if you use this line in your code what will we get?
Runtime error.
Depends on the code where you use
Compiles Fine
Compilation error.
1.Set s = new HashSet(); 2.s.add("JAVA"); 3.s.add(new Integer(5)); Line 3 will give ClassCast Exception because Two different types of object are getting added.
Which was the first evolved complete CPU on one chip?
Intel 8085
Intel 4004
Intel 8086
Intel 3003
1.Set s = new TreeSet(); 2.s.add("JAVA"); 3.s.add(new Integer(5)); Line 3 will give ClassCast Exception because Two different types of object are getting added.