Here you can find the source of printArray(String lt, String[] arr, String rt)
Parameter | Description |
---|---|
lt | a parameter |
arr | a parameter |
rt | a parameter |
public static void printArray(String lt, String[] arr, String rt)
//package com.java2s; public class Main { /**/*from www .ja v a 2 s.c o m*/ * @param lt * @param arr * @param rt */ public static void printArray(String lt, String[] arr, String rt) { 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); } } else { for (int i = 0; i < arr.length; i++) { System.out.println(lt + arr[i] + rt); } } } /** * @param lt * @param arr * @param rt */ public static void printArray(String lt, Object[] arr, String rt) { if (arr.length > 1) { for (int i = 0; i < arr.length; i++) { System.out.println(lt + arr[i] + rt); } } else { for (int i = 0; i < arr.length; i++) { System.out.println(lt + arr[i] + rt); } } } }