java 1.8
int id = 1;
int kind =2;
String name = "%gaaa"; // %g被误解为格式化字符
System.out.printf("name: %s id:%2d" + " kind " + kind +" ", name , id); //正确
System.out.printf("name" + name, "id:%2d" +" " , id); //报错
// 运行时报错
Exception in thread "main" java.util.IllegalFormatConversionException: g != java.lang.Integer
总结: %xx 后不能再接String