Hi to all.
I have an object 'o1' whose constructor is
o1(String[] arrayOfStrings)
{
...
}
and an ArrayList 'list' of object String:
list.add("Eleme nt 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?
I have an object 'o1' whose constructor is
o1(String[] arrayOfStrings)
{
...
}
and an ArrayList 'list' of object String:
list.add("Eleme nt 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?
Comment