今天学习了字串链接的操作;
代码部分:
package hydg;
public class EnumTest {
public static void main(String args[]) {
int X=100;
int Y=200;
System.out.println("X+Y="+X+Y);
System.out.println(X+Y+"=X+Y");
}
}
结果部分:
结果分析:
在输出语句中,引号中的部分都是照长输出,
区别是在引号外面加加的部分,当引号在前面的部分是后面连用两个加加相当于三个字符串的链接,
而前面是两个加加,最后面是个引号的时候前面两个加加相当于数值的相加。