1.) What is the difference in cursor placement between System.out.print() and System.out.println()?
A. print() leaves the cursor on the same line, println() puts the cursor on the line below text
B. There is no difference, print() and println() have the same functionality and cursor placement
C. print() leaves the cursor on the same line, println() puts a new line above the text
D. println() requires the "\n" escape sequence to create a new line, while print() does not
2.) Which escape sequences print text? Which format text?
A. Print: \", \' and \\ Format: \n and \t
B. Print: \\, \n, and \" Format: \t and \'
C. Print: \t, \", and \' Format: \n and \\
D. Print: \',\\, and \n Format: \t and \"
3.) What is the code to print out "Hello" with a new line above the text, and the cursor ending up under the text?
A. System.out.println("\nHello");
B. System.out.print("\nHello");
C. System.out.println(\n"Hello");
D. System.out.println("Hello\n");
4.) Which of the following is true about escape sequences?
I. They are all preceded by a backslash
II. Must all be placed between double quotes
III. Some are visible, others are not
IV. If you use them, you can omit the ';' at the end of println()
A. I and II, and III only
B. II and III only
C. I, III, and IV only
D. II and IV only
5.) What will System.out.print("\t\"\nighty night!\"\n"); do?
A. Indent, then print out a double quote, then print out ighty night!" on a new line putting the cursor on the next line
B. Indent, then print out "nighty night!" on the new line putting the cursor on the next line
C. Indent, then print a double quote, print out "ighty night!" on the new line putting the cursor on the same line
D. Indent, then print out \"nighty night!\", putting the cursor on the next line
6.) Which of the following correctly identifies the errors in the code below?
System.print(Hello!"))
I. out is missing from the print statement
II. Missing open double quote
III. Extraneous closing parentheses
IV. Missing semicolon
A. I and III only
B. III only
C. II, III, and IV only
D. I, II, III, and IV