Write a method named convertToArrayList() that accepts an int array as its parameter and returns an ArrayList of type Integer containing those same elements in the same order. This method stub is NOT provided for you - method name, parameter(s), and return type must match exactly to receive credit. You should not use the word static.

Respuesta :

Answer:

Explanation:

The following code is written in Java and is a method named convertToArrayList() which takes in a preset int array and converts it into an ArrayList called myDynamicArray in the exact same order.

public static void convertToArrayList(int[] myStaticArray) {

       ArrayList<Integer> myDynamicArray = new ArrayList<>();

       for (int x = 0; x < myStaticArray.length; x++) {

           myDynamicArray.add(myStaticArray[x]);

       }

   }

ACCESS MORE