200k views
1 vote
1. Which of the following statements contains an error?

I. Scanner in = new Scanner(System.in.print);
II. System.out.print("Please enter your name (first last): ");
III. String firstName = in.next();
I only
II only
III only
I and II only
II and III only
2. Which of the following statements contains an error?
I. String firstName = in.next();
II. String lastName = in.nextline();
III. System.out.print("\\");
I only
II only
III only
I and II only
II and III only

User Yavor S
by
8.6k points

1 Answer

7 votes

Answer:

Your answer is I. Scanner in = new Scanner(System.in.print);

II. System.out.print("Please enter your name (first last): ");

Step-by-step explanation:

User Andrew Koster
by
8.1k points