Click here to watch in Youtube :
https://www.youtube.com/watch?v=V6RBuahi1yU&list=UUhwKlOVR041tngjerWxVccw
Click the below Image to Enlarge
Java Tutorial : Java bitwise Unsigned Right Shift Operator |
Java Tutorial : Java bitwise Unsigned Right Shift Operator |
class BitwiseUnsignedRightShiftOperatorDemo { public static void main(String[] args) { int a = 240; // 11110000 System.out.println("binary of 'a' :" + Integer.toBinaryString(a) + "\n"); /* * Number of bits needs to be moved to Right. */ int b = 2; /* * The left operand value is moved right by the number of bits specified * by the right operand and shifted values are filled up with zeros. */ int value = a >>> b; // 00111100 System.out.println("binary of 'value' after\n unsigned right shift : " + Integer.toBinaryString(value)); System.out.println("Value : " + value); } }
binary of 'a' :11110000 binary of 'value' after unsigned right shift : 111100 Value : 60
https://sites.google.com/site/javaee4321/java/OperatorsDemoUnsignedRightShiftOperatorApp.zip?attredirects=0&d=1
Github Link:
https://github.com/ramram43210/Java/tree/master/BasicJava/OperatorsDemoUnsignedRightShiftOperatorApp
Bitbucket Link:
https://bitbucket.org/ramram43210/java/src/9c29c9c8cf10305cf0952ccfd17cdec26383c2e4/BasicJava/OperatorsDemoUnsignedRightShiftOperatorApp/?at=master
Refer:
http://www.binaryhexconverter.com/binary-to-decimal-converter
No comments:
Post a Comment