Sorting in String in Java

import java.util.Arrays;
 
public class SortStringArrayExample {
       
        public static void main(String args[]){
                String[] strNames = new String[]{"John", "alex", "Chris", "williams", "Mark", "Bob"};
                Arrays.sort(strNames);
               
                System.out.println("String array sorted (case sensitive)");

                for(int i=0; i < strNames.length; i++){
                        System.out.println(strNames[i]);
                }
                Arrays.sort(strNames);
               
                System.out.println("String array sorted (case insensitive)");
                //print sorted elements again
                for(int i=0; i < strNames.length; i++){
                        System.out.println(strNames[i]);
                }
 
        }
}