InterviewSolution
Saved Bookmarks
| 1. |
What Is The Output Of This Program? 1. Class Output { 2. Public Static Void Main(string Args[]) { 3. Arraylist Obj = New Arraylist(); 4. Obj.add("a"); 5. Obj.add("d"); 6. Obj.ensurecapacity(3); 7. Obj.trimtosize(); 8. System.out.println(obj.size()); 9. } 10. } |
|
Answer» trimTosize() is USED to reduce the size of the array that underlines an ARRAYLIST OBJECT. $ javac Output.java trimTosize() is used to reduce the size of the array that underlines an ArrayList object. Output: $ javac Output.java |
|