Online Java Compiler By
JavaTpoint.com
public class IntegerRotateLeftExample2 { public static void main(String[] args) { int value = 16; // Get the binary equivalent System.out.println("Binary equivalent: "+Integer.toBinaryString(value)); // get the number of one's int Result = Integer.rotateLeft(value, 3); System.out.println("Value after left rotation: "+Result); System.out.println("New Binary value after Rotated Left: "+Integer.toBinaryString(Result)); } }
Output