Search Header Logo

Printing in Java

Authored by Patrick Bryar

Computers

9th - 12th Grade

Used 2+ times

Printing in Java
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

8 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Consider the following code segment.

System.out.print("apple ");

System.out.print("banana ");

System.out.println("cherry ");

System.out.println("date ");

What is printed as a result of executing the code segment?

apple banana cherry date
apple banana cherry date
apple bananacherry date
applebananacherrydate

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Consider the following code segment.

System.out.println("1");

System.out.print("2");

System.out.println("3");

What is printed as a result of executing the code segment?

1

23

12

3

1

2

3

231

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Consider the following code segment.

System.out.print("Sun ");

System.out.println("Moon ");

System.out.print("Star ");

System.out.println("Sky ");

What is printed as a result of executing the code segment?

Sun

Moon Star

Sky

Sun

Moon Star

Sky

Sun Moon

Star Sky

Sun Moon Star Sky

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Consider the following code segment.

System.out.println("Monday");

System.out.println("Tuesday");

System.out.print("Wednesday");

System.out.print("Thursday");

What is printed as a result of executing the code segment?

Monday Tuesday WednesdayThursday
MondayTuesdayWednesdayThursday
Monday Tuesday Wednesday Thursday
Monday Tuesday WednesdayThursday

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Consider the following code segment.

System.out.println("Red " + "Yellow " + "Green ");

System.out.print("Blue " + "Purple ");

What is printed as a result of executing the code segment?

Red Yellow Green Blue Purple

Red

Yellow

Green Blue Purple

Red Yellow Green BluePurple
RedYellowGreenBluePurple

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Consider the following code segment.

System.out.print("Rock ");

System.out.print("Paper ");

System.out.println("Scissors ");

What is printed as a result of executing the code segment?

Rock Paper

Scissors

Rock Paper Scissors
RockPaperScissors

Rock

Paper

Scissors

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Consider the following code segment.

System.out.print("1");

System.out.println("2");

System.out.print("3");

System.out.println("4");

What is printed as a result of executing the code segment?

1234
12 34
1 2 3 4
12 3 4

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?