Java tutorial
//package com.java2s; public class Main { public static String addStringsWithSpaces(Object... params) { StringBuilder stringBuilder = new StringBuilder(); for (Object s : params) { stringBuilder.append(s); stringBuilder.append(" "); } return stringBuilder.toString(); } }