D
djbitchpimp
I am trying to cast an array of objects to an array of strings.
Basically like this:
String [] hosts ;
hosts = new String [3] ;
hosts [0] = "host1" ;
hosts [1] = "host2" ;
hosts [2] = "host3" ;
I then pass the array to a function that takes a type Object as
paramater. Inside the function, I want to get the Object back to a
String array.
I have tried:
hosts = (String []) o ;
but all my values come up null. Is this the correct way to cast this?
Basically like this:
String [] hosts ;
hosts = new String [3] ;
hosts [0] = "host1" ;
hosts [1] = "host2" ;
hosts [2] = "host3" ;
I then pass the array to a function that takes a type Object as
paramater. Inside the function, I want to get the Object back to a
String array.
I have tried:
hosts = (String []) o ;
but all my values come up null. Is this the correct way to cast this?