Using Comparable interface to sort JAVA -
hi example have :
string1[0] ="banana"; string1[1] ="apple"; string1[2] ="pineapple"; string1[3] ="mandarin";
i want sort alphabetically using comparable , compareto()
method. result be:
string1[0]="apple"; string1[1]="banana"; string1[2]="mandarin"; string1[3]="pineapple";
could show me skeleton of code plz ?
and there better way sort ?
Comments
Post a Comment