close

可以讓字串與字串或數字串接在一起

 class Con{

public static void main (String []args){

  String s1="01234";

  String s2=s1+10;

   int i=50;

System.out.println(s2);

System.out.println(i+s1);

 //+號的左邊跟右邊如果是字串那就會變成是字串串接而不會進行運算

}

}

/*

0123410
5001234

*/

arrow
arrow
    文章標籤
    java
    全站熱搜
    創作者介紹
    創作者 goodlucky23 的頭像
    goodlucky23

    goodlucky23的部落格

    goodlucky23 發表在 痞客邦 留言(0) 人氣()