package base;
public class Demo04 {
public static void main(String[] args) {
int a=3;
int b=4;
a+=b;
System.out.println(a);
//字符串连接符 + ,String
System.out.println(a+b);
System.out.println("乐"+a+b); // 和下面这一行进行对照注意区别
System.out.println(a+b+"");
System.out.println("================================================");
//三元运算符
// x ? y :z
//如果x=true,则结果为y,否则为z
boolean h = 4<3? true:false;
System.out.println(h);
}
}
05-19
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交