Hi so for example i have :
string1[0] ="Banana";
string1[1] ="Apple";
string1[2] ="Pineapple";
string1[3] ="Mandarin";
I want to sort this alphabetically using comparable and compareTo()
method.
So the result would be:
String1[0]="Apple";
String1[1]="Banana";
String1[2]="Mandarin";
String1[3]="Pineapple";
Could you just show me the skeleton of the code to do it plz ?
And is there a better way to sort it ?