Java BigInteger bitCount() MethodThe bitCount() method of Java BigInteger class is used to count the number of set bits. This method returns the number of bits in the two's complement representation of this BigInteger that differ from the sign bit of this BigInteger. Syntax:Returns:This method returns number of bits that differ from this BigInteger's sign bit. Note:ExampleTest it NowOutput: Result of bitCount operation on 7 is 3 Result ofbitCount operation on -7 is 2 Next TopicJava BigInteger |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India