package demo;
import java.text.MessageFormat;
public class doTest {
public static void main(String[] args) throws Exception {
System.out.println(String.format("Input = {0} and Output = {1}", 1,2));
System.out.println(MessageFormat.format("Input = {0} and Output = {1}", 1,2));
System.out.println();
System.out.println(String.format("Input = %d and Output = %d", 1,2));
System.out.println(MessageFormat.format("Input = %d and Output = %d", 1,2));
}
}
原文:https://www.cnblogs.com/lick468/p/10767820.html