Object... arguments 的参数形式。

String java.text.MessageFormat.format(String pattern, Object... arguments)

            int planet = 7;
            String event = "a disturbance in the Force";

            String result = MessageFormat.format(
                "At {1,time} on {1,date}, there was {2} on planet {0,number,integer}.",
                planet, new Date(), event);




直接 写多个对象接可以实现。

你可能感兴趣的:(java)