Java tutorial
public class Main { public static void main(String[] args) { long l = 8; System.out.println("Number = " + l); System.out.println("Binary = " + Long.toBinaryString(l)); System.out.println("After reversing = " + Long.reverseBytes(l)); } }