Examveda

What will be the output of the following Java code?
import java.util.*;
class properties 
{
    public static void main(String args[]) 
    {
        Properties obj = new Properties();
        obj.put("AB", new Integer(3));
        obj.put("BC", new Integer(2));
        obj.put("CD", new Integer(8));
        System.out.print(obj.keySet());
    }
}

A. {AB, BC, CD}

B. [AB, BC, CD]

C. [3, 2, 8]

D. {3, 2, 8}

Answer: Option B


This Question Belongs to Java Program >> Collections Framework In Java

Join The Discussion

Related Questions on Collections Framework in java