I have created an arraylist like this syntax:
List<?> obj = new ArrayList<Object>();
If I try to add a new Object or any object like String. It gives me compile error:
obj.add(new Object());
The method add(capture#1-of ?) in the type List<capture#1-of ?> is not applicable for the arguments (Object)
What are the objects I can add in obj
?.