I am just a beginner and do not know how to reverse text that I write on input so it is reversed on output. I wrote something like this:
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s = sc.nextLine();
String[] pole = {s};
for (int i = pole.length; i >= 0; i--) {
System.out.print(pole[i]);
} // TODO code application logic here
}
}
but it is not working and I cannot figure out why.