- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Integer.lowestOneBit() method in Java
The method Integer.lowestOneBit() returns an int value with at most a single one-bit, in the position of the lowest-order ("rightmost") one-bit in the specified int value.
Here we have a decimal value 294, whose binary is −
100100110
The lowest one bit is calculated using the lowestOneBit() method in Java.
Example
public class Demo { public static void main(String []args) { // binary 100100110 int dec = 294; System.out.println("Count of one bits = " + Integer.bitCount(dec)); System.out.println("Lowest one bit: " + Integer.lowestOneBit(dec)); } }
Output
Count of one bits = 4 Lowest one bit: 2
- Related Articles
- Collections.replaceAll() method and List.replaceAll() method in Java
- Method overloading in Java
- Method overriding in Java
- BigInteger.isProbablePrime() method in Java
- Integer.numberOfLeadingZeros() method in Java
- Integer.numberOfTrailingZeros() method in Java
- Integer.rotateLeft() method in Java
- Integer.signum() method in Java
- Integer.reverseBytes() method in Java
- isLetterOrDigit() method in Java
- The isEmpty() method of CopyOnWriteArrayList method in Java
- The hashCode() method of CopyOnWriteArrayList method in Java
- The clone() method of CopyOnWriteArrayList method in Java
- NavigableMap clear() Method in Java
- NavigableMap isEmpty() Method in Java

Advertisements