Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes using toArray in searchcriteria Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Badass: Making Users Awesome this week in the Game Development forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "using toArray in searchcriteria" Watch "using toArray in searchcriteria" New topic

using toArray in searchcriteria

Kevin Mc Cusker

Joined: Aug 06, 2003
Posts: 21
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

Joined: Feb 02, 2006
Posts: 2023
It is wire. Could you find out what kinds of objects are in the Object array?
I agree. Here's the link:
subject: using toArray in searchcriteria