Well done
Now some challenges for improvement.
1: Print it out with equal spacing, so 10 in the top row is exactly above 100 in the bottom row.2: Work out how to use only one print statement.Hints:
1: Finding out about System.out.printf and the % tags will help.2: I would probably use the String#format method. If you can work out the % tags for printf, they work exactly the same way for String#format.There is actually an advantage to using few print calls. Each print call takes a certain time, maybe a few milliseconds. That doesn't sound a lot, but if you are unlucky your 110 print instructions might take a half‑second or longer. Creating a String object probably takes a few microseconds or less. You can save time with a StringBuilder.
If you need a line end, try this, and don't use \n
private static final String LINE_END = System.getProperty("line.separator");
If that doesn't work I have got a spelling error in that
You can read about the % tags in the Java® Tutorials in two places:
1 2. One of them sorts out the line end problem.