-
What is the output of this program?
import java.util.*;
public class properties_Example
{
public static void main(String args[])
{
Properties object = new Properties();
object.put("PQ", new Integer(23));
object.put("SR", new Integer(46));
object.put("UV", new Integer(25));
System.out.print(object.keySet());
}
}
-
- [PQ, UV, SR]
- [PQ, UV]
- [UV, SR]
- [23, 46, 25]
- None of these
Correct Option: A
object.keySet() returns a set containing all the keys used in properties object, here object contains keys PQ, SR, UV therefore object.keySet() returns [PQ, SR, UV].