Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

using toArray in searchcriteria

 
Kevin Mc Cusker
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
Im using an arraylist to add all matches i get in the searchcriteria method. Say for example I have two matches. I then use the following line of code to change it into an array:

Object[] toArray = myArrayList.toArray();

I dont know why but the size of this array is always 10 times larger than the arraylist - 20 in this example!!.

Any comments welcome
 
wise owen
Ranch Hand
Posts: 2023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is wire. Could you find out what kinds of objects are in the Object array?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic