Here you can find the source of vectorToString(int[] v)
Parameter | Description |
---|---|
v | An input vector to get its formatted string representation |
public static String vectorToString(int[] v)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from w ww . j a va 2s . c o m*/ * Creates and returns a formatted string representation of the input vector v * @param v An input vector to get its formatted string representation * @return A formatted string of the input vector: [a, b, c..] */ public static String vectorToString(int[] v) { String str = "["; for (int i = 0; i < v.length; i++) str += v[i] + ((i < v.length - 1) ? ", " : ""); return str + "]"; } }