Question: In java programming,thanks This is one question in three tasks 2 of 2 Task 2 (using the ArrayList class) Add a new class the current

In java programming,thanks
This is one question in three tasks
 In java programming,thanks This is one question in three tasks 2

2 of 2 Task 2 (using the ArrayList class) Add a new class the current project and name it MyArrayList. In that class, add an instance variable, which is an ArrayList of integers. Use a constructor to populate the array list with numbers from a data file. Create a text file at the root of your project folder and then add 5 numbers to this file (one number per file). Use this file to populate the arraylist. Task 2 (using the ArrayList class) To the class you created in Task 2, add a method named reverseList0 that creates and returns an ArrayList which is the reverse of the original ArrayList. For example, if the original list was [2,4, -2, 5, 3, 0,7], the output from this method would be the list 17, 0, 3, 5, -2, 4, 2]. Task 3 (using the ArrayList class) To the same class from Task 2, add a method called makeCopies. This method will replace every integer k with k copies of itself. For example, if the list is: [2 4, -2, 5,3, 0, 7] before the method is invoked, it should be [2, 2, 4, 4, 4, 4, 5, 5, 5, 5, 5, 3, 3, 3, 7, 7, 7, 7, 7, 7, 7] after calling the method makeCopies. A negative value, or a 0 value, means that the value should be removed from the list. Test your method using the following list: [2, 4, -2, 5, 3,0,7,5]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!