
public class Hello{
public static void main(String[] args) {
//++ -- 自增 自减 一元运算符
int a = 3;
int b = a++;
int c = ++a;//先给a自增
System.out.println(a);
System.out.println(b);
System.out.println(c);
/*
A = 0011 1100
B = 0000 1101
----------------------------------------------------------------
A&B = 0000 1100 A并且B 1表示正确 0表示错误 1和0为0,1和1为1,1和0为0
A/B = 0011 1101 A或者B
A^b = 0011 0001 (相同取0,不同取1)
~B = 1111 0010
//package operator;
boolean a = true;
boolean b = false;\ */
<< 左移 乘二
>> 右移 除二
a+=b;
a-=b;
}
}
public class Hello{
public static void main(String[] args) {
/* int a = 10;
int b = 20;
a+=b;//a = a+b
a-=b;//a = a-b
System.out.println(a);
System.out.println(""+a+b);
System.out.println(a+b+"");*/
int score = 50;
String type = score < 60 ? "不及格" : "及格";//偷懒方法必须使用
System.out.println(type);
}
}
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)