This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

give me some idea

 
xiaoma wang
Ranch Hand
Posts: 74
  • 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
  • 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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks you very much, Michael!
xiaoma wang
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic