Write code to convert array To String
Append each element in the array to the string
//package com.book2s; public class Main { public static void main(String[] argv) { String[] array = new String[] { "1", "abc", "level", null, "book2s.com", "asdf 123" }; System.out.println(arrayToString(array)); }//from w w w .j av a2s. com public static String arrayToString(String[] array) { String toReturn = null; if (null != array) { toReturn = ""; for (int i = 0; i < array.length; i++) { toReturn += array[i] + ",\n"; } } else { System.out.println("arrayToString(null)!"); } return toReturn; } }