java.lang.Long.reverse()


java.lang.Long.reverse()

package com.codingdict;



import java.lang.*;



public class LongDemo {



   public static void main(String[] args) {



      long l = 210;

      System.out.println("Number = " + l);



      /* returns the string representation of the unsigned long value 

         represented by the argument in binary (base 2) */

      System.out.println("Binary = " + Long.toBinaryString(l));



      /* returns the value obtained by reversing order of the bits in the

         specified long value */ 

      System.out.println("After reversing = " + Long.reverse(l)); 

   }

}