Skip to content

Glossary: Algorithms Beyond the Basics in Java

Integer.bitCount / toBinaryString / 0b literal

Also written: Integer.bitCount, Integer.toBinaryString, 0b literal, 0b

Java tools for bits: `toBinaryString` shows a number's bits, a `0b` prefix writes a number in binary, and `bitCount` counts the 1 bits.

Where the book teaches it

Related terms

binarybitmask