Section 2.2: The print and println Methods, and the Java API
In Java, an argument is: A: A logical sequence of statements proving the correctness of a program B: Information that a method returns to its caller C: Information provided to a method D: A verbal dispute
C: Information provided to a method
Write a statement that prints Hello, world on to the screen.
System.out.println("Hello, world");
Suppose your name was Alan Turing. Write a statement that would print your last name, followed by a comma, followed by a space and your first name.
System.out.println("Turing, Alan");
The character escape sequence to represent a double quote is:
\"
The character escape sequence top represent a single quote is:
\'
The character escape sequence to represent a backslash is:
\\
The character escape sequence to force the cursor to go to the next line is:
\n
The character escape sequence to force the cursor to advance forward to the next tab setting is:
\t
Suppose your name was George Gershwin. Write a complete main method that would print your last name, followed by a comma, followed by a space and your first name.
public static void main(String[ ] a) { System.out.println("Gershwin, George"); }
Write a complete main method that prints Hello, world to the screen.
public static void main(String[ ] a) { System.out.println("Hello, world"); }
