Here you can find the source of printArray(float[] arr)
Parameter | Description |
---|---|
arr | An array of float values. |
public static void printArray(float[] arr)
//package com.java2s; /**/*from w w w. ja v a 2s . c o m*/ * Hub Miner: a hubness-aware machine learning experimentation library. * Copyright (C) 2014 Nenad Tomasev. Email: nenad.tomasev at gmail.com * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see <http://www.gnu.org/licenses/>. */ public class Main { /** * Prints out the array to standard output. * * @param arr An array of float values. */ public static void printArray(float[] arr) { if (arr == null) { System.out.println("Null array."); return; } for (int i = 0; i < arr.length - 1; i++) { System.out.print(arr[i] + " "); } System.out.print(arr[arr.length - 1]); System.out.println(); } /** * Prints out the array to standard output. * * @param arr An array of integer values. */ public static void printArray(int[] arr) { if (arr == null) { System.out.println("Null array."); return; } for (int i = 0; i < arr.length - 1; i++) { System.out.print(arr[i] + " "); } System.out.print(arr[arr.length - 1]); System.out.println(); } /** * Prints out the array to standard output. * * @param arr An array of double values. */ public static void printArray(double[] arr) { if (arr == null) { System.out.println("Null array."); return; } for (int i = 0; i < arr.length - 1; i++) { System.out.print(arr[i] + " "); } System.out.print(arr[arr.length - 1]); System.out.println(); } /** * Prints out the array to standard output. * * @param arr An array of string values. */ public static void printArray(String[] arr) { if (arr == null) { System.out.println("Null array."); return; } for (int i = 0; i < arr.length - 1; i++) { System.out.print(arr[i] + " "); } System.out.print(arr[arr.length - 1]); System.out.println(); } }