So, I have to use a selection sort to sort an array of Strings even though I know this is not the most efficent way and am getting messed up in my coding. The array is coming from a separate class called Bank Account and this is what I have so far: I know how to sort 2 integers, but am totally lost on Strings. Can anyone give me any insight/direction on where to go? Thanks in advance!!
public static void SelectionSort(BankAccount[] BankArray){
String currentName;
int currentLetterIndex;
int currentAccount;
for (int i=BankArray.length-1; i>1; i--){
//Find the maximum in the list
currentName.getName() = BankArray.EqualsIgnoreCase(currentName.getName());
currentLetterIndex = i;
for (int j=i-1; j>0; j--){
if (currentName.compareTo(BankArray[j].getName())){
currentName.getName() = BankArray[j].EqualsIgnoreCase(currentName.getName());
currentLetterIndex = j;
}//close if
}//close 2nd for
//Swap i with current letter index if necessary
if (currentLetterIndex != i){
BankArray[currentLetterIndex] = BankArray;
BankArray[j] = currentName;
}//close if
}//close 1st for
}//close SelectionSort method
public static void SelectionSort(BankAccount[] BankArray){
String currentName;
int currentLetterIndex;
int currentAccount;
for (int i=BankArray.length-1; i>1; i--){
//Find the maximum in the list
currentName.getName() = BankArray.EqualsIgnoreCase(currentName.getName());
currentLetterIndex = i;
for (int j=i-1; j>0; j--){
if (currentName.compareTo(BankArray[j].getName())){
currentName.getName() = BankArray[j].EqualsIgnoreCase(currentName.getName());
currentLetterIndex = j;
}//close if
}//close 2nd for
//Swap i with current letter index if necessary
if (currentLetterIndex != i){
BankArray[currentLetterIndex] = BankArray;
BankArray[j] = currentName;
}//close if
}//close 1st for
}//close SelectionSort method