Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

give me some idea

 
xiaoma wang
Ranch Hand
Posts: 74
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3451
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
xiaoma wang
Ranch Hand
Posts: 74
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks you very much, Michael!
xiaoma wang
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic