Collections.sort in Java

// Java program for Collections.sort() import java.util.*; public class JavaCollectionsort { public static void main(String[] args) { ArrayList list = new ArrayList(); list.add("Welcome"); list.add("Hellow"); list.add("Wprld"); al.add("Go"); list.add("for"); list.add("Javacodestuffs"); Collections.sort(al); // Let us print the sorted list System.out.println("List after the use of" + " Collection.sort() :\n" + al); } }