ExamVeda
Login
Home
Collections Framework in java
?

What will be the output of the following Java program?
class Output 
{
    public static void main(String args[]) 
    {
        ArrayList obj = new ArrayList();
        obj.add("A");
        obj.add("D");
        obj.ensureCapacity(3);
        obj.trimToSize();
        System.out.println(obj.size());
     }      
}

Answer & Solution
Correct Answer: Option B
Let's discuss the solution. Join the discussion
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.