Here you can find the source of arrayToString(float[] a)
public static String arrayToString(float[] a)
//package com.java2s; //License from project: Open Source License public class Main { public static String arrayToString(float[] a) { String result = ""; for (int i = 0; i < a.length; i++) { result += floatToString(a[i]) + " "; }//from w ww . j a v a 2s. c o m return result; } public static String arrayToString(double[] a) { String result = ""; for (int i = 0; i < a.length; i++) { result += a[i] + " "; } return result; } public static <T> String arrayToString(T[] a) { if (a == null) { return "[null]"; } String result = "["; for (int i = 0; i < a.length; i++) { result += a[i].toString() + " "; } return result + "]"; } /** * * @param array nullable * @return */ public static String arrayToString(String[] array) { if (array == null) { return "[null]"; } String result = ""; for (String s : array) { result += s + " "; } return result; } public static String arrayToString(int[] array) { String result = ""; for (int s : array) { result += s + " "; } return result; } /** * convert float to String with two fractional digits * @param value * @return */ public static String floatToString(float value) { if (Float.isNaN(value)) { return " --- "; } return String.format("%.2f", value); } }