Topic 2.2: Working With Java Data Types - Differentiate between object reference variables and primitive variables Flashcards

1
Q

What default values are assigned to uninitialized primitive variables?

A

Uninitialized primitive variables are assigned default values:

  • 0 for numeric types,
  • false for boolean,
  • and ‘\u0000’ for char.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does a
primitive variable
store when assigned a value?

A

This stores the actual value assigned to it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Name the eight primitive data types in Java.

A

The eight primitive data types in Java are:

byte, short, int, long, float, double, char, and boolean.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do primitive variables and object reference variables differ?

A

Primitive variables hold simple data values directly, while object reference variables hold references (memory addresses) to objects.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does an
object reference variable
store when assigned an object?

A

This stores the memory address of the assigned object.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What do
object reference variables
store?

A

These store references (memory addresses) to objects.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

These store references (memory addresses) to objects.

A

What do
object reference variables
store?

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What default value is assigned to an uninitialized object reference variable?

A

An uninitialized object reference variable is assigned the default value of null.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

This stores the memory address of the assigned object.

A

What does an
object reference variable
store when assigned an object?

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

This stores the actual value assigned to it.

A

What does a
primitive variable
store when assigned a value?

How well did you know this?
1
Not at all
2
3
4
5
Perfectly