/*
看程序写结果
字符串数据和其他数据做+,结果是字符串。
+字符串是连接符
*/
class DataType8{
public static void main(String[] args){
System.out.println("hello"+'a'+1);//helloa1
System.out.println('a'+1+"hello");//98hello
System.out.println("5+5="+5+5);//5+5=55
System.out.println(5+5+"=5+5");//10=5+5
}
}
Java中字符串的连接
最新推荐文章于 2023-07-28 22:42:29 发布