/* Hello2.java CIS 160 David Klick 2015-09-02 Demonstration of simple output using System.out.print and System.out.println. */ public class Hello2 { public static void main(String[] args) { // System.out.println displays the text you send it and then // adds a newline (to go to the next line on the display). System.out.println("Hello, world!"); // System.out.print displays the text, but stays on the same line. // "\n" outputs a newline, so the following does the same as the // System.out.println above. System.out.print("H"); System.out.print("e"); System.out.print("l"); System.out.print("l"); System.out.print("o"); System.out.print(", wo"); System.out.print("rld!\n"); // System.out.println() with no String to display still outputs a newline. System.out.println(); // goes to a new line System.out.println(); // goes to a new line System.out.println(); // goes to a new line } }