?
What will be the output of the following Java code?
What will be the output of the following Java code?
import java.util.*;
class Bitset
{
public static void main(String args[])
{
BitSet obj1 = new BitSet(5);
BitSet obj2 = new BitSet(10);
for (int i = 0; i < 5; ++i)
obj1.set(i);
for (int i = 3; i < 13; ++i)
obj2.set(i);
obj1.and(obj2);
System.out.print(obj1);
}
}
import java.util.*;
class Bitset
{
public static void main(String args[])
{
BitSet obj1 = new BitSet(5);
BitSet obj2 = new BitSet(10);
for (int i = 0; i < 5; ++i)
obj1.set(i);
for (int i = 3; i < 13; ++i)
obj2.set(i);
obj1.and(obj2);
System.out.print(obj1);
}
}
Join the Discussion
Login to post a comment or share your explanation.
Login