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) {
//from  w w w .  j a va  2  s  .  co m
    System.out.println(Integer.rotateLeft(10,2));

  }
}

The output:

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





















Home »
  Java Tutorial »
    java.lang »




Boolean
Byte
Character
Class
Double
Enum
Float
Integer
Long
Math
Number
Object
Package
Process
ProcessBuilder
Runnable
Runtime
SecurityManager
Short
StackTraceElement
StrictMath
String
StringBuffer
StringBuilder
System
Thread
ThreadGroup
ThreadLocal
Throwable