File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes give me some idea Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "give me some idea" Watch "give me some idea" New topic
Author

give me some idea

xiaoma wang
Ranch Hand

Joined: Mar 04, 2002
Posts: 74
hi, everybody:
I am busying doing the FBN assignment. And in coding criterialFind() method, I have a ArrayList instance, list, to store the DataInfo object, which satisfy the criteria requirement. u know, the return value should be DataInfo[], so i try to use :return (DataInfo[])list.toArray() to return the value. But "castException" is produced. something wrong when i use the toArray() method?
Thank in advance!
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
Hi Xiaoma,
The first time I used ArrayList the same thing happend to me. you have to do something like this:

Hope this helps
Michael Morris
SCJP2


Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
xiaoma wang
Ranch Hand

Joined: Mar 04, 2002
Posts: 74
Thanks you very much, Michael!
xiaoma wang
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: give me some idea