Home / MCQ Bank / Computer
Computer Collections Framework In Java Difficulty: Medium

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); } }

Select the correct option to test your answer:

More Computer Questions

What will be the output of the following C# code? class method1 { public int fun(int m) { return( m++ % 10); } } class Program { static void Main(string[] args) { int a = 23, b = 0, c; method1 z = new method1(); c = z.fun (++b * --a % 2); int d = (z.fun (c-- + --a)); Console.WriteLine(c); Console.WriteLine(a++); Console.WriteLine(d); Console.ReadLine(); } } Which system variable controls the size of the table cache? What is the output of the following code: my_list = [1, 2, 3] print(list(reversed(my_list))) What is the recommended way to comment out multiple lines of code in Ruby? In Ruby, how do you convert a string to an array of characters?