Here you can find the source of formatNumbers(final int... numbers)
Parameter | Description |
---|---|
numbers | to format |
public static String formatNumbers(final int... numbers)
//package com.java2s; /* See LICENSE for licensing and NOTICE for copyright. */ public class Main { /**// ww w. j av a 2s . com * Returns a formatted string to describe the supplied numbers. * * @param numbers to format * * @return formatted string */ public static String formatNumbers(final int... numbers) { final StringBuilder sb = new StringBuilder(); if (numbers.length == 1) { sb.append(numbers[0]).append(" "); } else { sb.append("( "); for (int number : numbers) { sb.append(number).append(" "); } sb.append(") "); } return sb.toString(); } }