Recall & Review
beginner Click to reveal answer
What is a primitive type in Java?
A primitive type in Java is a basic data type that stores simple values directly in memory, such as int, double, boolean, and char.
beginner Click to reveal answer
How does Java store reference types differently from primitive types?
Java stores reference types as addresses (references) pointing to objects in the heap memory, not the actual object data itself.
beginner Click to reveal answer
What happens when you assign one primitive variable to another?
The value of the primitive variable is copied directly, so both variables hold independent copies of the data.
beginner Click to reveal answer
What happens when you assign one reference variable to another?
The reference (address) is copied, so both variables point to the same object in memory.
intermediate Click to reveal answer
Why is understanding primitive vs reference storage important?
It helps avoid bugs by knowing when changes affect original data or just copies, and how memory is managed in Java.
Which of these is a primitive type in Java?
✗ Incorrect
int is a primitive type; String, ArrayList, and Object are reference types.
When you assign one reference variable to another, what happens?
✗ Incorrect
The reference (address) is copied, so both variables point to the same object.
Which memory area stores primitive variables in Java?
✗ Incorrect
Primitive variables are stored on the stack when declared inside methods.
If you change the value of a primitive variable copied from another, what happens to the original?
✗ Incorrect
Primitive values are copied independently, so the original stays unchanged.
Which of these is true about reference types?
✗ Incorrect
Reference types store addresses pointing to objects in the heap.
Explain the difference between primitive and reference storage in Java.
Think about how variables hold data versus addresses.
You got /5 concepts.
Describe what happens in memory when you assign one reference variable to another in Java.
Focus on what the variables actually hold.
You got /4 concepts.
