Here you can find the source of format(String format, Object... args)
public static String format(String format, Object... args)
//package com.java2s; import java.util.Formatter; public class Main { public static String format(String format, Object... args) { return format(null, format, args); }//from w w w .j a va2s . co m public static String format(StringBuilder builder, String format, Object... args) { if (builder == null) { builder = new StringBuilder(); } new Formatter(builder).format(format, args); return builder.toString(); } }