Ask your own question, for FREE!
Computer Science 19 Online
OpenStudy (anonymous):

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("\n"); I only II only III only I and II only II and III only

OpenStudy (anonymous):

the first one 1 and 2 have errors in them

OpenStudy (anonymous):

second one 2 has an error

OpenStudy (anonymous):

OpenStudy (anonymous):

OpenStudy (woodrow73):

Here's a link to some info regarding the Scanner class; https://www.udemy.com/blog/java-scanner/

OpenStudy (anonymous):

Thank you guys! What about these: Which of the following statements does not contain an error? (2 points) I. String userAge = in.next(); II. String ageInYears = Integer.parseInt(userAge); III. double approxAgeInDays = ageInYears * 365.25; Which of the following statements does not contain an error? (2 points) I. double approxAgeInDays = ageInYears * 365.25; II. ageInHours = (int)approxAgeInDays * 24; III. ageInMinutes = ageInHours * 60; Which of the following statements do not contain an error? (2 points) I. String firstInitial = firstName.subString(0,1); II. String capsLastName = lastName.toUpperCase(); III. String name = firstInitial + ". " + capsLastName;

OpenStudy (anonymous):

you're new to java? i would suggest you try the lines of code...

OpenStudy (anonymous):

Yes I am... okay!

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!