Printing in Java

Printing in Java

9th - 12th Grade

8 Qs

quiz-placeholder

Similar activities

Loops

Loops

9th - 12th Grade

10 Qs

Compound Operators in Java

Compound Operators in Java

9th - 12th Grade

12 Qs

Java Basics #2

Java Basics #2

10th - 12th Grade

7 Qs

Java Loops

Java Loops

9th - 12th Grade

12 Qs

Code.org APCSA Unit

Code.org APCSA Unit

10th - 12th Grade

10 Qs

AP Computer Science A

AP Computer Science A

10th - 12th Grade

10 Qs

Java Strings

Java Strings

9th - 12th Grade

12 Qs

Java Boolean Statements

Java Boolean Statements

11th Grade

11 Qs

Printing in Java

Printing in Java

Assessment

Quiz

Computers

9th - 12th Grade

Hard

Created by

Patrick Bryar

Used 2+ times

FREE Resource

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

8.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Consider the following code segment.

System.out.println("A " + "B");

System.out.println("C");

System.out.print("D " + "E ");

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

A B

C

D E

A BCD E

A B

CD E

AB CDE