Which statements can be inserted at (1) without the compiler reporting any errors?
public class Main { public static void main(String[] args) { List<?> lst = new ArrayList<String>(); // (1) INSERT HERE } }
Select the two correct answers.
(a) and (e)
In (b) and (c), we cannot add any object to the list as the list is of an unknown type.
From a list of an unknown type, we are only guaranteed to get an Object.
In (d) capture-of ? cannot be converted to String.