Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jul 18th, 2005, 7:09 AM   #1
yusufozkay
Newbie
 
Join Date: Jul 2005
Posts: 6
Rep Power: 0 yusufozkay is on a distinguished road
Converting object to arraylist

I put ArrayLists into an ArrayList. I send this ArrayList to a class. In that class I will use the ArrayLists. In this class i defined a new ArrayList. In this class every time the timer elapsed I will get the next ArrayList to this new ArrayList that I defined in the class. But when i wrote
arrListInClass = mainArrList[counter];
error occurs because of casting, it cannot cast object to arraylist. help?!?
yusufozkay is offline   Reply With Quote
Old Jul 18th, 2005, 9:08 AM   #2
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
Try this:
arrListInClass = (ArrayList)mainArrList[counter];
This "typecasts" the object contained in the arraylist to the ArrayList type before copying it into your variable.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 6:29 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC