Java Character reverseBytes() MethodThe reverseBytes(char ch) method of Character class returns the values obtained by reversing the bytes in a particular order for a given value. SyntaxParameterch: It is the character that needs to be tested. Return ValueThe reverseBytes(char ch)method returns the value which is obtained by reversing the bytes in their specified char values. Example 1Output: Enter the first input:Helllo The reversing of the character 'H' will provide the result as:18432 The reversing of the character 'e' will provide the result as:25856 The reversing of the character 'l' will provide the result as:27648 The reversing of the character 'l' will provide the result as:27648 The reversing of the character 'l' will provide the result as:27648 The reversing of the character 'o' will provide the result as:28416 Enter the second input:World The reversing of the character 'W' will provide the result as:22272 The reversing of the character 'o' will provide the result as:28416 The reversing of the character 'r' will provide the result as:29184 The reversing of the character 'l' will provide the result as:27648 The reversing of the character 'd' will provide the result as:25600 Example 2Output: The reversing of bytes for the first character is given as: ] The reversing of bytes for the second character is given as: M Next TopicJava-character-tochars-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