import java.util.Scanner;
class ReverseWord {
public static void main(String args[]) {
Scanner myScanner = new Scanner(System.in);
char c1, c2, c3, c4;
c1 = myScanner.findInLine(“.”).charAt(0);
c2 = myScanner.findInLine(“.”).charAt(0);
c3 = myScanner.findInLine(“.”).charAt(0);
c4 = myScanner.findInLine(“.”).charAt(0);
System.out.print(c4);
System.out.print(c3);
System.out.print(c2);
System.out.print(c1);
System.out.println();
}
}
the code above if you type
stop
in the windows prompt window will put the output of
pots
but im wondering what this part does
charAt(0);
at what would happen if i changed it to
charAt(1);
thanks, i know what the rest does though.