Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

convert arraylist into array

807603Sep 1 2005 — edited Dec 13 2007
hi

firstly i know this question have been asked many times before, but it seems I can't yet solve my problem on converting arraylist to array.

here's what i did (i refer to the posting at http://forum.java.sun.com/thread.jspa?forumID=256&threadID=418025 ) :
void searchDate(String date){
ArrayList tempRequestID = new ArrayList();
int[] requestID;

requestID = new int[tempRequestID.size()];

//now I would like to put the values from arraylist into the array requestID, so I put this line
requestID  = (int[])tempRequestID.get(requestIDsize);
}
but everytime the code get executed, this error will apper:
Error in function searchIssuanceDate(): Index: 13, Size: 13 
*actually this is a search function so the actual values in the index and size may vary..

what did i do wrong? any help is greatly appreciated.. thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 10 2008
Added on Sep 1 2005
14 comments
516 views