Search Header Logo

Java Programming Quiz

Authored by Abiodun Asemota

Computers

12th Grade

Used 4+ times

Java Programming Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

55 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 2 pts

Which of the following correctly declares an int variable in Java?

int number = 5.0;

int number = 5;

int number = '5';

int number = true;

2.

MULTIPLE CHOICE QUESTION

1 min • 2 pts

What is the size of a double data type in Java?

2 bytes

4 bytes

8 bytes

16 bytes

3.

MULTIPLE CHOICE QUESTION

1 min • 2 pts

What is the default value of a boolean data type in Java?

true

false

0

1

4.

MULTIPLE CHOICE QUESTION

1 min • 2 pts

Which of the following represents a valid char declaration in Java?

char letter = "A";

char letter = 'A';

char letter = 65;

Both B and C

5.

MULTIPLE CHOICE QUESTION

1 min • 2 pts

What is the maximum value that an int data type can hold in Java?

2,147,483,647

4,294,967,295

9,223,372,036,854,775,807

1,000,000

6.

MULTIPLE CHOICE QUESTION

1 min • 2 pts

Which of the following is a valid double literal in Java?

double value = 5;

double value = 5.0;

double value = 5.0f;

double value = "5.0";

7.

MULTIPLE CHOICE QUESTION

1 min • 2 pts

Which statement correctly compares two boolean variables, a and b, in Java?

if (a = b)

if (a == b)

if (a.equals(b))

if (a != b)

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?