Question
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);
}
}
a.
{0, 1, 3, 4}
b.
{0, 1, 2, 4}
c.
{0, 1, 2, 3, 4}
d.
{0, 0, 0, 3, 4}
Posted under Java Programming
Engage with the Community - Add Your Comment
Confused About the Answer? Ask for Details Here.
Know the Explanation? Add it Here.
Q. What is the output of this program?
Similar Questions
Discover Related MCQs
Q. What is Remote method invocation (RMI)?
View solution
Q. Which of these package is used for remote method invocation?
View solution
Q. Which of these methods are member of Remote class?
View solution
Q. Which of these Exceptions is thrown by remote method?
View solution
Q. Which of these class is used for creating a client for a server-client operations?
View solution
Q. Which of these package is used for all the text related modifications?
View solution
Q. Which of these return type of hasNext() method of an iterator?
View solution
Q. Which of these methods is used to obtain an iterator to the start of collection?
View solution
Q. Which of these methods can be used to move to next element in a collection?
View solution
Q. Which of these iterators can be used only with List?
View solution
Q. Which of these is a method of ListIterator used to obtain index of previous element?
View solution
Q. Which of these exceptions is thrown by remover() method?
View solution
Q. Which of the below is not a subinterface of Queue?
View solution
Q. What is the remaining capacity of BlockingQueue whose intrinsic capacity is not defined?
View solution
Q. PriorityQueue is thread safe.
View solution
Q. What is difference between dequeue() and peek() function of java?
View solution
Q. What is the difference between Queue and Stack?
View solution
Q. What are the use of front and rear pointers in CircularQueue implementation?
View solution
Q. What is the correct method used to insert and delete items from the queue?
View solution
Q. Which data structure is used in Breadth First Traversal of a graph?
View solution
Suggested Topics
Are you eager to expand your knowledge beyond Java Programming? We've curated a selection of related categories that you might find intriguing.
Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!