Here you can find the source of printArray(double[] a)
Parameter | Description |
---|---|
a | a parameter |
public static void printArray(double[] a)
//package com.java2s; //License from project: Open Source License public class Main { /**//w w w .j ava 2 s . c o m * print array of values in one line * @param a */ public static void printArray(double[] a) { for (int i = 0; i < a.length; i++) { System.out.format("%.2f ", a[i]); } System.out.println(); } public static void printArray(float[] a) { for (int i = 0; i < a.length; i++) { System.out.format("%.2f ", a[i]); } System.out.println(); } public static void printArray(String[] a) { printArray(a, " "); } /** * print array of values in one line * @param a */ public static void printArray(String[] a, String sep) { for (int i = 0; i < a.length; i++) { System.out.print(a[i] + sep); } System.out.println(); } }