2. Output System.out.println(“Hello”); Notes: Capital letter S in System Use the dot (.) after System and out Whatever is between the quotes “” will be displayed when the program is executed A semicolon (;) must be used at the end of the line
3. Output System.out.println(); This statement will leave a blank line on the screen System.out.println(“ Hello”); This statement will leave some space on the left hand side of the screen an then print the word Hello
4. Output System.out.println(“Hello”); Note: Leaving space before the System.out.println statement will not in any way affect the output. Java ignores the space. In order to affect the output, the space must be left somewhere between the quotes (“”)
5. Output Difference between the methods print and println System.out.println(“Hello”); This will output the word Hello and then move the cursor to the next line System.out.print(“Hello”); This will output the word Hello and then keep the cursor on the same line