You are provided with an array of Strings and a list of Strings.Sort the elements (1) in natural order, (2) in reverse naturalorder and (3) by the length of each String. You can fill in thedetails by using the following stub file:
import java.util.Arrays;import java.util.Collections;import java.util.List;public class Midterm01 { public static void main(String[] args) { String[] arrayOfCities = { \"Atlanta\", \"Savannah\", \"New York\", \"Dallas\", \"Rio\" }; List listOfCities = Arrays.asList(\"Atlanta\", \"Savannah\", \"New York\", \"Dallas\", \"Rio\"); System.out.print(\"\nSorting a String array in natural order...\"); // your work here System.out.print(\"\nSorting a String array in reverse natural order...\"); // your work here System.out.print(\"\nSorting a String array by length of the Strings...\"); // your work here System.out.print(\"\nSorting a String list in natural order...\"); // your work here System.out.print(\"\nSorting a String list in reverse natural order...\"); // your work here System.out.print(\"\nSorting a String list by length of Strings...\"); // your work here }}