- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Integer.reverseBytes() method in Java
The method returns the value obtained by reversing the order of the bytes in the two's complement representation of the specified int value. Let us now see the syntax.
int reverseBytes(int i)
The following is the parameter.
- i − This is the int value
Example
public class Demo { public static void main(String []args) { System.out.println(Integer.reverseBytes(0)); System.out.println(Integer.reverseBytes(-87)); System.out.println(Integer.reverseBytes(98)); } }
Output
0 -1442840577 1644167168
Advertisements