Issue
What I'm trying to do is progressively "reverse print" an alphabetical string from right to left like this:
A
BA
CBA
DCBA
etc...
Here is the foundation I'm working from which currently prints in normal order:
public static void main(String[] args)
{
String output = "";
for(char alphabet = 'A'; alphabet <='Z'; alphabet++ )
{
output += alphabet;
System.out.println(output);
}
}
Any help at all would be appreciated.
Solution
Change output += alphabet;
tooutput = alphabet + output;
This does the job.
Answered By - gst1502