I'm trying to work with java.util.ArrayList in a Java project in Eclipse. It resolves funny on this IDE, contrary to what I'm used to on NetBeans. For example:
On NetBeans, I can create a Generic ArrayList simply as follows:
List<Bundle> bundles = new ArrayList();
However, on Eclipse, this is the structure, if I'm to successfully declare and initialize an ArrayList:
List bundles = (List) new ArrayList<Bundle>();
I'm forced to do a type casting, and the Generisation can only be done on the right side.
This, however, is not too bad, untill I try to call call some of the ArrayList methods, such as bundles.add(bundle1);. I get an error highlight on the method add().
dundles. Ctrl+space gives me a 'No Default Proposals'
Have I got my IDE platform badly, or incompletely configured? What could be the problemo?
Thank you all in advance.
--- >
Eclipse Java EE IDE for Web Developers.
Version: Mars.1 Release (4.5.1)
Build id: 20150924-1200
--- >
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) Client VM (build 25.60-b23, mixed mode)
java.util.Listand not some other kind ofList? - Titus