public class OutputTest { public static void main(String args[]) { /* Special characters \t and \n */ System.out.println("Welcome to Java Programming"); System.out.println("Welcome\tto\tJava\tProgramming"); System.out.println("Welcome\nto\nJava\nProgramming"); /* The difference between System.out.print and System.out.println */ System.out.print("First line"); System.out.print("Still first line"); System.out.print("Still first line"); System.out.print("\nSecond line, finally\n"); /* * For the following 2 statements, try to remove one backslash from each * statement and see what happens. */ System.out.println("\\"); System.out.println("\"Hello\", he said."); /* Evaluation order and string concatenation */ System.out.println("result is: " + "10 + 20 + 3"); System.out.println("result is: " + 10 + 20 + 3); System.out.println("result is: " + (10 + 20) + 3); System.out.println("result is: " + (10 + 20 + 3)); System.out.println("result is: " + 10 + 20 * 3); System.out.println("result is: " + (10 + 20) * 3); } }