Java Long.rotateLeft(long i, int distance)

Syntax

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

public static long rotateLeft(long i,  int distance)

Example

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


public class Main {
// w  ww.  jav a 2s .  co m
  public static void main(String[] args) {

    long n = 64;

    n = Long.rotateLeft(n, 4);
    System.out.println(n);

  }
}

The code above generates the following result.





















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