import java.util.ArrayList; import java.util.Collections; public class Example { public static void main(String[] args) { ArrayListIn this example, we create an ArrayList called numbers and add some integer values to it. We then call the Collections sort method on the numbers list to sort the elements in ascending order. Finally, we print the sorted list using System.out.println. The Collections sort method is part of the java.util package library.numbers = new ArrayList (); numbers.add(4); numbers.add(2); numbers.add(6); numbers.add(1); Collections.sort(numbers); System.out.println(numbers); // Output: [1, 2, 4, 6] } }