Javatpoint Logo
Javatpoint Logo

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

Test it Now

Output:

Reversed short value is = 7680

Example 2

Test it Now

Output:

Reversed short value is = 23040

Example 3

Test it Now

Output:

Reversed short value is = -3071

Next TopicJava Short





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA