Answer:
Follows are the method definition to this question:
public ArrayList<Integer> reverse(int[] contents)//defining a method reverses that accept an integer array contents
{
ArrayList<Integer> l = new ArrayList<Integer>();//defining ArrayList object l
for(int i = contents.length-1;i>=0;i--)//defining for loop that for add value
{
l.add(contents[i]);//use add method to add value in contents variable
}
return l;//use return keyword to return list l
}
Step-by-step explanation:
In the above-given method definition, an ArrayList type method reverse is defined, that accepts an integer array contents in its parameter, inside the method an array object "l" is defined.
In the next step, a "for" loop is used, which uses the add method to add value to the array list and use the return keyword to return its value.