By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,737 Members | 1,989 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,737 IT Pros & Developers. It's quick & easy.

String[] and Object[]

P: n/a
Hi to all.
I have an object 'o1' whose constructor is

o1(String[] arrayOfStrings)
{
...
}

and an ArrayList 'list' of object String:

list.add("Element of list");

How can I pass the strings of 'list' to the object 'o1'?
I don't know how to use the toArray method of ArrayList, because

new o1(list.toArray());

returns an array of object (Object[]) and 'o1' doesn't like it.
Is there a way to convert Object[] into String[]?
Can you help me?
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Never mind, I found it.
Just

o1((String[])list);
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.