public void strings() throws IOException {
System.out.println("Write somthing, press enter, repeat once");
BufferedReader inp = new BufferedReader(
new InputStreamReader(System.in));
String a;
String b;
char c;
char d;
a = (inp.readLine()).toLowerCase(); // done before char comparison
b = (inp.readLine()).toLowerCase();
int i = 0;
while (true != false) {
try {
c = (a.toCharArray()[i]);
} catch (ArrayIndexOutOfBoundsException ex) {
System.out.println(a);
System.out.println(b);
return;
}
try {
d = (b.toCharArray()[i]);
} catch (ArrayIndexOutOfBoundsException ex) {
System.out.println(b);
System.out.println(a);
return;
}
if (c == d) {
i++;
continue;
}
if (c < d) {
System.out.println(a);
System.out.println(b);
return;
} else {
System.out.println(b);
System.out.println(a);
return;
}
}
}
BufferedReader inp = new BufferedReader(new InputStreamReader(System.in));