List of utility methods to do Array Output
void | printArray(int[] array) print Array if (array != null) { for (int i = 0; i < array.length - 1; i++) { System.out.print(array[i] + ", "); System.out.println(array[array.length - 1]); |
void | printArray(int[][] array, String arrayLabel, String rowLabel, String columnLabel) print Array System.out.println(arrayLabel); for (int i = 0; i < array.length; i++) { if (rowLabel != null) System.out.print(rowLabel + (i + 1) + ": "); for (int j = 0; j < array[i].length; j++) { if (columnLabel != null) System.out.print(columnLabel + ","); System.out.print(array[i][j] + " "); ... |
void | printArray(int[][] num) print Array for (int i = 0; i < num.length; i++) { for (int j = 0; j < num[i].length; j++) System.out.print(num[i][j] + "\t"); System.out.println(); |
void | printArray(Object array) print Array int maxmax = 10; if (array instanceof float[]) { int maxI = ((float[]) array).length; if (maxI > maxmax) maxI = maxmax; System.out.print("["); for (int i = 0; i < maxI; i++) { System.out.print(((float[]) array)[i]); ... |
void | printArray(Object[] arry, String specialText) print Array for (int i = 0; i < arry.length; i++) { System.out.println(specialText + arry[i].toString()); |
void | printArray(Object[] data) Prints an array to the console for (int i = 0; i < data.length; i++) { if (i != data.length - 1) System.out.print(data[i] + ", "); else System.out.print(data[i] + "\n"); |
String | printArray(Object[] in) print Array if (in == null) return "null"; String out = ""; for (int i = 0; i < in.length; i++) { out += in[i].toString() + " ; "; return out; |
void | printArray(String lt, String[] arr, String rt) print Array if (arr.length < 1) System.out.println("[EMPTY]"); else if (arr.length > 0) { for (int i = 0; i < arr.length; i++) { if (i < 9) System.out.println(" " + (i + 1) + lt + arr[i] + rt); else System.out.println("" + (i + 1) + lt + arr[i] + rt); ... |
void | printArray(String name, int[] array) print Array Integer[] temp = new Integer[array.length]; for (int i = 0; i < array.length; i++) temp[i] = Integer.valueOf(array[i]); printArray(name, temp); |
String | printArray(T[] array) print Array StringBuilder builder = new StringBuilder(); for (int i = 0; i < array.length; i++) builder.append(array[i]); return builder.toString(); |