sorting a list java strings code example
Example: How to sort a string array in java
// java program to sort an array using Arrays.sort() method
import java.util.Arrays;
public class JavaArraySortMethod
{
public static void main(String[] args)
{
String[] strGiven = {"Great Barrier Reef", "Paris", "borabora", "Florence","tokyo", "Cusco"};
Arrays.sort(strGiven);
System.out.println("Output(case sensitive) : " + Arrays.toString(strGiven));
}
}