Search Header Logo

CH 2 - Java Fundamentals

Authored by Alex Zaldivar

Computers

University

Used 47+ times

CH 2 -  Java Fundamentals
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is not a valid Java comment?

/** Comment 1 */

*/ Comment 2 /*

// Comment 3

/* Comment 4 */

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

When saving a Java source file, save it with an extension of

.java.

.javac.

.src.

.class.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

This is a value that is written into the code of a program.

Literal

Assignment statement

Operator

Variable

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is not a rule that must be followed when naming identifiers?

After the first character, you may use the letters a-z, A-Z, an underscore, a dollar sign, or digits 0-9.

Identifiers can contain spaces.

Uppercase and lowercase characters are distinct.

The first character must be one of the letters a-z, A-Z, an underscore or a dollar sign.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Character literals are enclosed in ________, and string literals are enclosed in ________.

single quotes, double quotes

double quotes, single quotes

single quotes, single quotes

double quotes, double quotes

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the result of the following expression?

17 % 3 * 2 - 12 + 15

105

12

7

8

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the value of z after the following statements have been executed?

int x = 4, y = 33;

double z;

z = (double) (y / x);

8.25

4

0

8.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?

Discover more resources for Computers