测试左移和右移代码

		System.out.println("******************************");
		int a = 9;
		System.out.println("a  "+a);
		System.out.println("a>>1   "+   (a>>1));
		int b = (a>>1);
		System.out.println("b  "+b);
		System.out.println("a>>1  "+   (a>>1));


		
		
		System.out.println("******************************");
		int x = -9;
		
		System.out.println("x  "+ (x)+ "   ");
		System.out.println(Integer.toBinaryString(x));
		System.out.println("x>>>1  "+(x>>>1)+ "   ");
		System.out.println(Integer.toBinaryString(x>>>1));
		
		System.out.println("******************************");
		x = -9;
		
		System.out.println("x  "+(x)+ "   ");
		System.out.println(Integer.toBinaryString(x));
		System.out.println("x>>1  "+(x>>1)+ "   ");
		System.out.println(Integer.toBinaryString(x>>1));


已标记关键词 清除标记
相关推荐
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页