public class SelectionSort {   public static void main(String[] args)   {     String[] names ={Susie,Jose,Becky,David};          //Display the unsorted array          display(names);     System.out.println("\n");          //sort array using selection sort          selectionsort(nnames);        }      public static void selectionsort(int[] array)   {     //startScan will hold the starting index of the scan of the unsorted region     int startScan;     //minIndex will hold the index of the element with the smallest value in the scanned area     int minIndex;          int minValue;     //index is a counter variable used to hold an index     int index;          //outer for loop iterates once for each element in the array placing the smallest     //value found in the scanned region(unsorted region), except for the last element     //The startScan variable marks the position where the scan should begin          for (startScan=0;startScan<(array.length-1);startScan++)     {       minIndex=startScan;       minValue=array[startScan];       //inner loop scans the array, starting at the 2nd element in the scannable        //region(unsorted region)       for(index=startScan+1;index<array.length;index++)       {         if(array[index]<minValue)         {           minValue=array[index];           minIndex=index;         }       }       swapNames(startScan, minIndex, array);       display(array);       System.out.println("\n");     }   }          public static void swapNames(int i, int j, int[] array)     {       int temp;       temp=array[i];       array[i]=array[j];       array[j]=temp;     }      public static void display(int[] array)   {     for(int value: array)     {       System.out.print("["+value+"] ");     }   } }