BITWISE OPERATOR IN JAVA - RIGHT SHIFT OPERATOR,RIGHT SHIFT OPERATOR WITH NEGETIVE NUMBER,UNSIGNED RIGHT SHIFT OPERATOR
public class j05_bitwize_operator {
public static void main (String[] args) {
// Right shift operator
int x = 33;
System.out.println(x >> 1);
System.out.println(x >> 2);
// with negetive number
int y = -2;
System.out.println(y>> 1);
//Unsigned Right Shift
int z = -2;
System.out.println(z >>> 1);
}
}
Comments
Post a Comment