Collections and Generics

© examsiri.com
Question : 5 of 53
 
Marks: +1, -0
Given:
public void takeList( List < ? extends String > list) {
  /*insert code here*/
}

place the compilation results on each code statement to indicate whether or not that code will compile if inserted into the list() method
code statements
1. list.add("Foo");
2. list = new ArrayList < String > ();
3. list = new ArrayList < Object > ();
4. String s = list . get(0);
5. Object o = list;
Go to Question: