Search Header Logo

Java Primitive Practice

Authored by Angel Ligon

Other

12th Grade

Used 4+ times

Java Primitive Practice
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is not a primitive data type in Java?

int
String
boolean
char

Answer explanation

The String data type is not a primitive data type in Java; it is a reference type used to represent sequences of characters.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which data type is used to store whole numbers in Java?

float
double
int
char

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the range of the int data type in Java?

-2,147,483,648 to 2,147,483,647
-32,768 to 32,767
0 to 4,294,967,295

-2,648 to 2,647

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which data type is used to store characters in Java?

int
float
char
boolean

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a proper way to declare a variable in Java?

myInteger = 100;

char = 'a';

int myNumber = 10;

int myNumber;

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a proper way to declare and initialize a variable in Java?

myInteger = 100;

char = 'a';

int myNumber = 10;

int myNumber;

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following variable names follows best practices for naming a variable?

5apples

someVariable

applesnum

numApples

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?