File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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
jQuery in Action, 3rd edition