这是一个例子:
int n1 = 20;
int n2 = 40;
String output = String.format("Some guy is **%d** years old while the other is **%d** ", n1, n2);
System.out.println(output);
为什么这不起作用?
答案 0 :(得分:0)
我发现它在我测试时效果很好,它将打印如下:
Some guy is 20 years old while the other is 40