Question: 1. What will the following code print out when it is run? Scanner scan = new Scanner(Hello world this is a new line!); scan.nextLine(); scan.next();

1.

What will the following code print out when it is run?

Scanner scan = new Scanner("Hello world this is a new line!"); scan.nextLine(); scan.next(); scan.next(); System.out.print(scan.next());

Group of answer choices

this

new

a

is

line!

2.

What is the output from the following code?

String s = "University of Wisconsin"; String s1 = s.substring(10,13); String s2 = s1.substring(2); String s3 = s2.trim(); System.out.println("#" + s3 + "#");

Group of answer choices

#o#
# of #
#f#
#of#

3.

What will be printed out when the following code is run?

int x = 0; int y = 3; if (x > 0 || (y / x) == 3) System.out.println("true"); else System.out.println("false");

Group of answer choices

false

divide by zero error

true

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!