73
Java Short reverseBytes() method
The reverseBytes() method of Java Short class is used to obtain a primitive short value reversing the order of bits in two?s complement form of the given short value.
Syntax
Parameters
S: The value whose bytes will be reversed.
Return value
It returns the value obtained by reversing the bytes in the specified short value.
Exception
N/A
Example 1
Output:
Reversed short value is = 7680
Example 2
Output:
Reversed short value is = 23040
Example 3
Output:
Reversed short value is = -3071
Next TopicJava Short