posted 12 years ago
Make a subclass of Items. Create a method that takes only Items or the Items subclass. Prove it.
I got some errors that I can't resolve.
WildcardCollection.java:9: unexpected type
found : ? extends Items
required: class or interface without bounds
ArrayList<? extends Items> l = new ArrayList<? extends Items>();
^
WildcardCollection.java:10: cannot find symbol
symbol : method add(Items)
location: class java.util.ArrayList<capture#262 of ? extends Items>
l.add(new Items("hola",1));
^
Any Idea?