Topic 2.2: Working With Java Data Types - Differentiate between object reference variables and primitive variables Flashcards
What default values are assigned to uninitialized primitive variables?
Uninitialized primitive variables are assigned default values:
- 0 for numeric types,
- false for boolean,
- and ‘\u0000’ for char.
What does a
primitive variable
store when assigned a value?
This stores the actual value assigned to it.
Name the eight primitive data types in Java.
The eight primitive data types in Java are:
byte, short, int, long, float, double, char, and boolean.
How do primitive variables and object reference variables differ?
Primitive variables hold simple data values directly, while object reference variables hold references (memory addresses) to objects.
What does an
object reference variable
store when assigned an object?
This stores the memory address of the assigned object.
What do
object reference variables
store?
These store references (memory addresses) to objects.
These store references (memory addresses) to objects.
What do
object reference variables
store?
What default value is assigned to an uninitialized object reference variable?
An uninitialized object reference variable is assigned the default value of null.
This stores the memory address of the assigned object.
What does an
object reference variable
store when assigned an object?
This stores the actual value assigned to it.
What does a
primitive variable
store when assigned a value?