Here you can find the source of convertToString(String[] args)
public static String convertToString(String[] args)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; public class Main { public static String convertToString(String[] args) { List<String> stringList = new ArrayList<>(); for (int i = 0; i < args.length; i++) stringList.add(args[i]);//from w w w . j a va 2 s . c o m return convertToString(stringList); } private static String convertToString(List<String> strings) { StringBuilder builder = new StringBuilder(); for (String s : strings) builder.append(s + " "); String out = removeLast(builder.toString()); return out; } private static String removeLast(String str) { if (str.length() > 0) { str = str.substring(0, str.length() - 1); } return str; } }