Thread: Bounded Array
View Single Post
  #3 (permalink)  
Old 01-03-2008, 12:56 PM
roots's Avatar
roots roots is offline
Moderator
 
Join Date: Jan 2008
Location: Dallas
Posts: 258
roots is on a distinguished road
If you are concerned on including the Generics things as well, make it like

Code:
int size = 10 ; ArrayList<Object> array = new ArrayList<Object>[size] ;
If your elements in array are not of same type then you need to cast them to their original type before using them. instanceof operator can be useful in this case.
__________________
dont worry newbie, we got you covered.
Reply With Quote