Question: Java I need to write a method for the ArrayIntList class that doubles the size of an arraylist by replacing every number in the list
Java
I need to write a method for the ArrayIntList class that doubles the size of an arraylist by replacing every number in the list with two of that number. e.g.
[2, 10, 12, 8, 14] and we call the list it should give
[2, 2, 10, 10, 12, 12, 8, 8, 14, 14]
this is what I did so far but it's wrong. Please help.
public void stretch(){ ArrayList
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
