Search Header Logo

Java Printing Quiz

Authored by Elisa Lovejoy

Computers

8th Grade

Java Printing Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

11 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the proper syntax for the print method for printing in Java?

print()

println()

printf()

display()

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which method is used to print variables and literals in Java?

print()

println()

printf()

display()

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code? int x = 5; System.out.print(x);

5

0

null

Error

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code? String name = "John"; System.out.println("Hello, " + name);

Hello, John

Hello, name

Hello, null

Error

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a valid way to print the value of a variable in Java?

System.out.print(variable)

System.out.print("variable")

System.out.print('variable')

System.out.print("'variable'")

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code? int a = 10; int b = 20; System.out.println(a + b);

1020

30

Error

null

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code? System.out.print(10 + "20");

1020

30

Error

null

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?