Jan 24, 2005 #1 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!
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!
Jan 25, 2005 #2 Diancecht Programmer Jan 8, 2004 4,042 ES 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 Upvote 0 Downvote
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