If youre up for a bit more of a challenge, try arranging the output in a visual

Question:

If you’re up for a bit more of a challenge, try arranging the output in a visual triangle. The statement above prints one element on a line by itself. The built-in System. out object has another output method: print(). This method does not print a newline after it prints whatever argument was passed in. You can chain together several System.out.print() calls to produce one line of output:

System.out.print("Hello"); System.out.print(" "); System.out.print("triangle!"); System.out.println(); // We

Your final output should look similar to this: 

% java Triangle 0 12 2 3 4 3 4 5 6 45678

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Learning Java An Introduction To Real World Programming With Java

ISBN: 978-1098145538

6th Edition

Authors: Marc Loy, Patrick Niemeyer, Daniel Leuck

Question Posted: