Java - Write code to convert int array to String Array

Requirements

Write code to convert int array to String Array

Demo

//package com.book2s;

public class Main {
    public static void main(String[] argv) {
        int[] intArray = new int[] { 34, 35, 36, 37, 37, 37, 67, 68, 69 };
        System.out.println(java.util.Arrays
                .toString(toStringArray(intArray)));
    }/*from w  w  w  .  j  a va 2  s.  c o  m*/

    public static String[] toStringArray(int[] intArray) {
        String[] res = new String[intArray.length];
        for (int i = 0; i < intArray.length; i++) {
            res[i] = Integer.toString(intArray[i]);
        }
        return res;
    }
}

Related Exercise