字符串的方法

1.格式化字符串

String name = "nikki";
int age = 29;
String sentence = String.format("attention! age of %s is %d", name, age);

2.拼接字符串
System.out.println("最大值是:" + max);
posted @ 2021-01-11 17:53  周周和奇奇  阅读(60)  评论(0编辑  收藏  举报