总结:<<:乘法

   >>:除法

package com.mmm;

public class dfd {
	public static void main(String[] args) {
		int i=2;
		int s=i<<3;//这里是2*8(2的3次方)
		System.out.println(s);
		int s2=i<<4;
		System.out.println(s2);//结果应该是32
		int j=160;
		int s3=j>>2;//结果是160/4=40;
		System.out.println(s3);
	}
}
//
16
32
40

  

相关文章:

  • 2021-07-12
  • 2021-11-08
  • 2021-07-13
  • 2022-12-23
  • 2022-12-23
  • 2022-03-01
  • 2022-12-23
  • 2021-11-27
猜你喜欢
  • 2021-11-28
  • 2022-12-23
  • 2021-07-22
  • 2022-12-23
  • 2021-05-21
  • 2022-02-26
相关资源
相似解决方案