Java Integer.rotateRight(int i, int distance)

Syntax

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

public static int rotateRight(int i,  int distance)

Example

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


public class Main{
  public static void main(String args[]) {
    int n = 1;//from  ww  w . j  a v  a 2s. co  m
    for (int i = 0; i < 16; i++) {
      n = Integer.rotateRight(n, 1);
      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