Write a Java code that declares an ArrayList containing the elements bellow

Programming
Tutor: None Selected Time limit: 1 Day

1) ["Alas", "poor", "I", "him", "Horatio"]

Write code that declares an ArrayList containing the elements above. What is the size of the list? What is its type?

Nov 21st, 2015

Thank you for the opportunity to help you with your question!

List <String>ListStrings=new ArrayList<String>();

ListStrings.add("Alas");

ListStrings.add("poor");

ListStrings.add("i");

ListStrings.add("him");

ListStrings.add("Horatio");

System.out.println(ListStrings);

System.out.println(ListStrings.size());





Please let me know if you need any clarification. I'm always happy to answer your questions.
Nov 21st, 2015

Studypool's Notebank makes it easy to buy and sell old notes, study guides, reviews, etc.
Click to visit
The Notebank
...
Nov 21st, 2015
...
Nov 21st, 2015
Dec 11th, 2016
check_circle
Mark as Final Answer
check_circle
Unmark as Final Answer
check_circle
Final Answer

Secure Information

Content will be erased after question is completed.

check_circle
Final Answer