Java Data Type Tutorial - Java Integer.rotateLeft(int i, int distance)








Syntax

Integer.rotateLeft(int i, int distance) has the following syntax.

public static int rotateLeft(int i, int distance)

Example

In the following code shows how to use Integer.rotateLeft(int i, int distance) method.

public class Main {
  public static void main(String[] args) {

    System.out.println(Integer.rotateLeft(10,2));

  }
}

The output:

The code above rotates value 10 to left for distance of 2.