Q167
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());
A.
1
B.
2
AnswerC.
3
D.
4
Answer: Option B
Solution
Answer: Option B
No explanation is given for this question Let's Discuss on Board