Home / MCQ Bank / Computer
Computer Collections Framework In Java Difficulty: Medium

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()); } }

Select the correct option to test your answer:

More Computer Questions

Which of the following tag is used for audio in HTML5? In . . . . . . . . copy, the modification done on one list affects the other list. In . . . . . . . . copy, the modification done on one list does not affect the other list. What is the purpose of the HBase Time-to-Live (TTL) feature? An operating system version designed for use with a media center PC is Microsoft Windows XP What is the average retrieval time when n keys hash to the same slot?