Interviews1 answer
What is bitset in Java? Give an example.
1 Answer
BitSet is a class defined in the java.util package. It creates an array of bits represented by boolean values.
Constructors:
BitSet class Constructors
/ \
BitSet() BitSet(int no_Of_Bits)
BitSet() : A no-argument constructor to create an empty BitSet object.
BitSet(int no_Of_Bits): A one-constructor with an integer argument to create an instance of the BitSet class with an initial size of the integer argument representing the number of bits.
Sarthak VarshneyPosted Jun 21, 2019, 4:56 AM EDT