Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Create a class object named YourNameChristmasList with the main method in it. Wi

ID: 3659505 • Letter: C

Question

Create a class object named YourNameChristmasList with the main method in it. Within main, create an array list to store a string of your wish list items. The array list should not have a pre-set number of items. Add 10 items in the array list. Use a for-each loop to display the content of your array list. Run your program and capture your output in a MS Word document called YourNameChristmasList. Add "A new java book" as the second item in the array list. Again, run your program and capture your output in your document. Your've been extra nice so add 5 more items to your wish list. Remove the 4th item because you got it for your birthday. Display the contents of your array list again and capture your output in your document. Your java file should be called YourNameChristmasList.java In your MS Word document, please include answers to the following questions. Please paste these questions into the document: When you completed step #8, what happened to the items on the right of the array list? For step #10, where did the 5 items get added? What happened to the array list after you removed the 4th item? Suppose I have two ArrayLists with 5 Strings in each. They are called MehaBirthdayList and MehaChristmasList. What happens if I were to write the code: MehaChristmasList = MehaBirthdayList;? Would the contents of MehaChristmasList be the contents of MehaBirthdayList? Describe what the clone(); method of ArrayLists do. What are the two main drawbacks of ArrayLists?

Explanation / Answer

/*you may download the YourNameChristmasList .docx from.....http://www.2shared.com/file/rMVEIXoy/YourNameChristmasList_.html*/ import java.util.ArrayList; public class YourNameChristmasList { public static void main(String[] args) { ArrayList stringList = new ArrayList(); stringList.add("John"); stringList.add("Mohan"); stringList.add("Lino"); stringList.add("Tiger"); stringList.add("Help"); stringList.add("computer"); stringList.add("orange"); stringList.add("friuts"); stringList.add("table"); stringList.add("mouse"); System.out.println("Elements Of array List : "); for (int i = 0; i
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote