Friday, May 24, 2013

Convert an object array to a string array in Java


  • System.arraycopy(Object src, int srcPos, Object dest, int destPos, int length);
  • Arrays.asList(Object_Array).toArray(new String[Object_Array.length]);  
  • Java 1.6
        String[] stringArray = Arrays.copyOf(objectArray, objectArray.length, String[].class);

Refs

No comments:

Post a Comment