File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -115,13 +115,14 @@ f(n)=f(n-1)+f(n-2)+...+f(1)
115115```
116116#### ** 补充:**
117117** java中有三种移位运算符:**
118- 1 . << : ** 左移运算符** ,等同于乘2的n次方
119- 2 . >> : ** 右移运算符** ,等同于除2的n次方
120- 3 . >>> ** 无符号右移运算符** ,不管移动前最高位是0还是1,右移后左侧产生的空位部分都以0来填充。与>>类似。
118+
119+ 1 . “<<” : ** 左移运算符** ,等同于乘2的n次方
120+ 2 . “>>”: ** 右移运算符** ,等同于除2的n次方
121+ 3 . “>>>” ** 无符号右移运算符** ,不管移动前最高位是0还是1,右移后左侧产生的空位部分都以0来填充。与>>类似。
121122例:
122123 int a = 16;
123124 int b = a << 2;//左移2,等同于16 * 2的2次方,也就是16 * 4
124125 int c = a >> 2;//右移2,等同于16 / 2的2次方,也就是16 / 4
125126
126127** 欢迎关注我的微信公众号(分享各种Java学习资源,面试题,以及企业级Java实战项目回复关键字免费领取):**
127- ![ 微信公众号] ( https://user-gold-cdn.xitu.io/2018/3/19/1623c870135a3609?w=215&h=215&f=jpeg&s=29172 )
128+ ![ 微信公众号] ( https://user-gold-cdn.xitu.io/2018/3/19/1623c870135a3609?w=215&h=215&f=jpeg&s=29172 )
You can’t perform that action at this time.
0 commit comments