Search Header Logo

Java Lesson 9

Authored by Rohit Sharma

Other

5th Grade - University

Used 1+ times

Java Lesson 9
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

12 questions

Show all answers

1.

FILL IN THE BLANK QUESTION

30 sec • 1 pt

What will the following code segment print?

System.out.println(4 / 5);

2.

FILL IN THE BLANK QUESTION

30 sec • 1 pt

What will the following code segment print?

System.out.println(4 * 2.0);

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the value in variable x after this code segment is executed?

String x = "" + 4 + 2;

"6"

"6.0"

There will be a runtime error

There will be a syntax error

"42"

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the value in variable x after this code segment is executed?

int x = (int) 5.0 / 2;

2

2.5

There will be a runtime error

There will be a syntax error

3

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the value in variable x after this code segment is executed?

double x = (double) 5 / (int) 2

2

2.5

There will be a runtime error

There will be a syntax error

2.0

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the value in variable x after this code segment is executed?

double x = (double) 5 / (int) 2

2

2.5

There will be a runtime error

There will be a syntax error

2.0

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the value of num?
double num = Math.sqrt(49);

7
7.0

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?