位运算
package operator;
public class Demo03 {
public static void main(String[] args) {
/*
A=0011 1100
B=0000 1100
A&B=0000 1100
A|B=0011 1101
A^B=0011 0001
~B=1111 0011
<< *2
>>/ 2
*/
}
}
package operator;
public class Demo04 {
public static void main(String[] args) {
int a=10;
int b=20;
// a+=b;
//a-=b;
System.out.println(a);
//字符串连接符 +
System.out.println("" + a + b);
System.out.println(a+b+"");
//三元运算符
/*
x?y:z
如果x==TRUE,则结果为y,否则结果为z
*/
int score=90;
String Type=score>89?"优秀":"良好";
System.out.println(Type);
}
}
标签:运算,0011,int,System,println,public,out
From: https://www.cnblogs.com/yyrldp/p/16790087.html