Java Variable Naming and Data Types

Java Variable Naming and Data Types

Assessment

Interactive Video

Computers

11th Grade

Hard

Created by

Laura Frauenberg

FREE Resource

4 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In programming, what is a variable primarily defined as?

A type of computer memory that cannot be changed.

A storage location that holds a value.

A fixed piece of information in a program.

A mathematical symbol used in algebra.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What two aspects does a variable's data type specify?

Its name and its size in memory.

Its storage location and its accessibility.

The type of information it can store and what operations can be performed on it.

Whether it is a primitive or reference type.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following are examples of primitive data types in Java?

String, Array, Object

int, double, boolean, char

List, Map, Set

Class, Interface, Enum

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a valid and recommended variable name according to Java naming conventions?

_totalAmount

1stValue

MyVariable

item-count