List of utility methods to do Array Print
void | printArray(T[] array) print Array int len = array.length; System.out.print("["); for (int i = 0; i < len; i++) { if (i != len - 1) { System.out.print(array[i] + ", "); } else { System.out.println(array[i] + "]"); |
void | printArray(T[] array) print Array printArray(array, 0, array.length); |
String | printArrayElements(T[] array) print Array Elements if (array == null) { return "null"; if (array.length == 0) { return "[]"; StringBuilder out = new StringBuilder(); out.append('['); ... |
void | printArrayFrom(int[] array, int start) print Array From if (start >= array.length) { System.out.println("[]"); return; System.out.print("["); for (int i = start; i < array.length; i++) { System.out.print(array[i]); if (i != array.length - 1) { ... |
void | printArrayInfo(int[] array) print Array Info try { System.out.println("The array lenght is: " + array.length); System.out.println("Some text!!!!!!!!!!!!"); System.out.println("The third element is: " + array[2]); } catch (NullPointerException e) { System.out.println("The array must not be null!"); } catch (ArrayIndexOutOfBoundsException e) { System.out.println("The array must has at least 3 elements"); ... |
void | printArrayNoSpaces(int[] nums) print Array No Spaces for (int i : nums) { System.out.print(i + ""); System.out.println(); |
void | printArrayRec(int[] workArray, int idx) print Array Rec if (idx < 0 || idx >= workArray.length) return; System.out.println(workArray[idx]); printArrayRec(workArray, idx - 1); |
String | printArrayToString(Object[] array) Print an Object ArrayHelper to a String. if (array == null) return "null"; StringBuffer buffer = new StringBuffer(); buffer.append('{'); for (int i = 0; i < array.length; i++) { if (i > 0) buffer.append(','); buffer.append(array[i]); ... |
void | printErrInvocationString(String cls, String[] args) print Err Invocation String System.err.println(toInvocationString(cls, args)); |
void | printfirstBytes(String comment, byte[] input) printfirst Bytes System.out.println("\n" + comment); for (int i = 0; i < 32; i++) { if (i > 0 && i % 32 == 0) System.out.println(""); System.out.print(" " + input[i]); System.out.println(""); |