Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ArrayStoreException

Status
Not open for further replies.

jaydy

MIS
Nov 9, 2003
27
PH
Hi All,

I have this code that generates an error

String[] AdminCustomers = (String[]) mCustomerList.toArray(new String[0]);

mCustomerList is a Vector populated by items from a Long[] array..

How can I correct this?

I need to return a String[]

Thanks!
 
I don't think you can do that on a single step. I can see two options:

1.- Create a new Vector, populate it with Long values transformed to Strings and then use the toArray method.

2.- Use toArray method to get a Long[] and them transform it to String[] element by element.

I'd use second one.

Cheers,

Dian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top