Vidyalelo
Java Programming · Q141

Java Collections Framework

Programming · Java Programming · question 141

Q141

What will be the output of the following Java code? import java.util.*; class Bitset public static void main(String args[]) BitSet obj = new BitSet(5); for (int i = 0; i < 5; ++i) obj.set(i); obj.clear(2); System.out.print(obj.length() + " " + obj.size());

A.
4 64
B.
5 64
Answer
C.
5 128
D.
4 128

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board