Java SE5 引入了 String.format() 静态方法

public class Test6 {
    
    public String getStr(int id ,int num ,String msg){
        return String.format("%d %d %s", id,num,msg);
    }
    
    public static void main(String[] args) {
        Test6 t = new Test6();
        String str = t.getStr(1, 2, "3");
        System.out.println(str);
    }
}

String.format()

相关文章:

  • 2022-12-23
  • 2021-06-15
  • 2021-08-27
  • 2022-01-01
  • 2021-11-03
  • 2021-06-20
猜你喜欢
  • 2021-10-19
  • 2021-12-12
  • 2021-07-15
相关资源
相似解决方案