Question 1
Is ArrayList> same as ArrayList extends Object>?
◦ Yes
◦ No
Question 2
Which of the following can be used to replace YYYYYYYY in the following code?
public class WildCardDemo3 {
public static void main(String[] args) {
| GenericStack stack1 = new GenericStack(); |
| GenericStack |
| WildCardDemo2.print(stack2); |
}
public static
void add(GenericStack stack1,
| while (!stack1.isEmpty()) |
| stack2.push(stack1.pop()); |
}
}
◦ ? super Object
◦ ? super T
◦ ? extends Object
◦ ? extends T