Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Java
Creating objects.
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="chris brat, post: 1549016"] This seems to be a very complicated way to add objects to a list. Why not do this // create a list - standard Java utils List<MyBase> myCol = new ArrayList(); // can be any impl of List interface. // create the objects you need MyBase obj1 = new MyChildA(); MyBase obj2 = new MyChildB(); // add to the list myCol.add(obj1); myCol.add(obj2); // retrieve the objects you need - could be either MyChildA or MyChildB instance MyBase retrieved = myCol.get(1); // work on the retrieved object Why do you want to extend AbstractList ? What functionality are you wanting to add? Chris [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Java
Creating objects.
Top