前五题半
/** * 需求:基本练习 * 思路:数据类型的一直 * * 步骤:略 */ public class Demo_1{ public static void main(String[] args) { System.out.println("5+5="+5+5); int a=3,b; b=a++;//a++是先使用后自增 ++a是先自增后使用 System.out.println("a=" + a + ",b=" + b); int x=3,y; y=++x; System.out.println("x=" + x + ",y=" + y); short s=3; s=(short)(s+4);//s是short类型的 4是int类型 System.out.println("s="+s); short S=3; S+=4;//虽然s+=4就是s=s+4但是 +=是赋值语句相当于=级别 System.out.println("S="+S); System.out.println(6&3); System.out.println(6|3); System.out.println(6^8);//!!!!当不一样的时候为真 1和0为真 一样的时候为假 0和0 1和1 System.out.println(3<<2); System.out.println(3>>1); int q=0,t; t=q>1?100:200; System.out.println("t="+t); } }
![](https://images2017.cnblogs.com/blog/1231829/201709/1231829-20170926162355292-1967715449.png)
This moment will nap, you will have a dream; but this moment study, you will interpret a dream.