方法一

String output = String.format("ExampleProgram - %s - %s ", 1, 2);
System.out.println(output);

方法二

import java.text.MessageFormat;

String out=MessageFormat.format("my name is {0}", 1);
System.out.println(out);

 

 

如果是打印的话 用lombook的 @Slf4j 的方法

log.info("pageResUser param = {}",json);

 

相关文章:

  • 2021-07-21
  • 2021-08-30
  • 2021-06-29
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-09-28
  • 2022-12-23
  • 2021-11-27
  • 2021-08-31
  • 2021-07-26
相关资源
相似解决方案