
To sort 10items in alphabetical order

Arrays.sort(name of ur array)

import java.util.*;
class ArrayExample{
public static void main(String[] args) {
String array[]=new String[5];
Scanner input = new Scanner(System.in);
System.out.println("Enter strings: ");
for(int i=0;i<array.length;i++){
array[i]=input.next();
}
Arrays.sort(array);
for(int i=0;i<array.length;i++){
System.out.println(array[i]);
}
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.