Home » JAVA Programming » Collections » Question
  1. What is the output of this program?
     import java.util.*;
    public class Result
    {
    public static void main(String args[])
    {
    ArrayList object = new ArrayList();
    object.add("Y");
    object.add("O");
    object.add("U");
    System.out.println(object.size());
    }
    }
    1. Y
    2. O
    3. U
    4. 3
    5. None of these
Correct Option: D

3



Your comments will be displayed only after manual approval.