| Author |
ArrayList containing array of objects
|
Gaurav Chikara
Ranch Hand
Joined: Jun 09, 2000
Posts: 410
|
|
I have an arraylist whose each element is a fixed size array of object Wwe dont have any API to retrive array of object from ArrayList and therefore I was wondering who can we retrieve each element as an array from arraylist If any one has any idea please help
|
SCJP,SCWCD,SCBCD<br />If Opportunity doesn't knock then build the door
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16483
|
|
|
This is hardly an advanced topic. Just cast from Object to Thing[], or whatever it's an array of:
|
 |
Garrett Rowe
Ranch Hand
Joined: Jan 17, 2006
Posts: 1295
|
|
We dont have any API to retrive array of object from ArrayList
We can however retrieve an Object from an ArrayList, and if that Object is an array, we can cast it to an array and use it.
|
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peter
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32694
|
|
|
If you are using the latest versions of Java (5+) you shouldn't be messing abouit with casts in the first place. Take all the casting out, and declare your List as generic.becomesTry it and see.
|
 |
 |
|
|
subject: ArrayList containing array of objects
|
|
|