forked from deepdalsania/tutorials
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShfit.java
More file actions
30 lines (22 loc) · 675 Bytes
/
Shfit.java
File metadata and controls
30 lines (22 loc) · 675 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package extraknowledge;
public class Shfit {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int a = -2, c = -2;
int b = 7;
System.out.println("a : "+Integer.toBinaryString(a));
System.out.println("b : "+Integer.toBinaryString(b));
System.out.println(b >> 2);
System.out.println(b >>> 2);
System.out.println("Before :"+Integer.toBinaryString(a));
a = a >> 1;
System.out.println("After : "+Integer.toBinaryString(a));
System.out.println("Before :"+Integer.toBinaryString(c));
c = c >>> 1;
System.out.println("After :"+Integer.toBinaryString(c));
//System.out.println(a);
}
}