Any quick method to count the number of set bits in a BitSet other than the usual 'keep a counter' method?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
The cardinality() method returns the number of set bits.
(Assuming you don't want to call cardinality())
see javadoc
Output: