Java Long.lowestOneBit(long i)

Syntax

Long.lowestOneBit(long i) has the following syntax.

public static long lowestOneBit(long i)

Example

In the following code shows how to use Long.lowestOneBit(long i) method.


//from www .j  a  v a2s.  c o  m
public class Main {

   public static void main(String[] args) {

     long l = 100;
     System.out.println("Number = " + l);
    
     System.out.println("Binary = " + Long.toBinaryString(l));

     System.out.println("Lowest one bit = " + Long.lowestOneBit(l));
   }
}

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