I am trying to write code that will take a given word (in this case "Alphabet") and print it backwards. With my current method, I manage to get it to print backwards, however, instead of printing on character per line, it is printing the entire word, starting with the last character on the first print line and then adding the following character on the next.
public class Main {
public static void main(String[] args) {
System.out.println();
System.out.println();
String backwards = "Alphabet";
for (int i = backwards.length(); i >= 0; i--) {
System.out.println(backwards.substring(i));
}
System.out.println();
System.out.println();
}
}