Java Integer reverseBytes MethodThe reverseBytes() method of Java Integer class numerically returns the value obtained by reversing the order of the bytes in the 2's complement binary representation of the specified integer value. Syntax:Following is the declaration of reverseBytes() method: Parameter:
Returns:The reverseBytes() method returns the numeric value obtained by reversing order of the bytes in the specified int value. Exceptions:NA Compatibility Version:Java 1.5 and above Example 1Output: Number = 202 After reversing = -905969664 Example 2Output: Enter Integer Value: 208 Number = 208 Binary Representation = 11010000 After reversing = -805306368 Example 3Output: Number = 202 Binary Representation = 11001010 After reversing = -905969664 Number = -50 Binary Representation = 11111111111111111111111111001110 After reversing = -822083585 Example 4Output: Enter Number from console: 850 Result: 5909567136040222720 Next TopicJava-integer-reverse-method |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India