我是Java新手,来自Python.在Python中我们像这样进行字符串格式化:
>>> x = 4 >>> y = 5 >>> print("{0} + {1} = {2}".format(x, y, x + y)) 4 + 5 = 9 >>> print("{} {}".format(x,y)) 4 5
我如何在Java中复制相同的东西?
python java string format placeholder
format ×1
java ×1
placeholder ×1
python ×1
string ×1