String s1 = \"Project\";
String s2 = \"Sunject\";
I want to compare the two above string by their alphabetic order (which in this case \"Project\"
import java.io.*;
import java.util.*;
public class CandidateCode {
public static void main(String args[] ) throws Exception {
Scanner sc = new Scanner(System.in);
int n =Integer.parseInt(sc.nextLine());
String arr[] = new String[n];
for (int i = 0; i < arr.length; i++) {
arr[i] = sc.nextLine();
}
for(int i = 0; i 0) {
String temp = arr[i];
arr[i] = arr[j];
arr[j] = temp;
}
}
}
for(int i = 0; i