difference between System.out.printf and String.format

后端 未结 5 536
野趣味
野趣味 2021-01-04 00:34

may i know what is the difference between the two in java? i am reading a book and it can either use both of it to display strings.

5条回答
  •  自闭症患者
    2021-01-04 01:11

    String.format formats strings, doesn't display them. I think you mean System.out.println(String.format("......", ....)) or some similar construct ?

提交回复
热议问题