Question 1 (Multiple Choice Worth 2 points) Which of the following statements contains an error? I. Scanner in = new Scanner(System.in); II. System.out.print(Please enter your name (first last): ); III. String firstName = in.next();
Welcome to Math’s section!
II System print, if you do a speech, it should be within speech marks so when it says Please enter your name it should be System.out.print("Please enter your name (first, last): ");
however an alternative would be to declare a String, then print it String name = "Please enter your name (first last)" System.out.print(name + " : ");
This is most definitely a test question. Computer Science teachers are really strict about cheating and plagiarism. Be careful. Adding on: II. System.out.print(Please enter your name (first last): ); Please enter your name (first last): is NOT in QUOTATIONS. This makes it an error.
Join our real-time social learning platform and learn together with your friends!