Two Kinds of Data: Primitives and References¶
☕ Java 17
Java stores data in two very different ways. Primitives hold a raw value; references hold the address of an object. Knowing which is which explains how variables behave, what can be null, and why == sometimes surprises you.
In this series¶
| # | Page | Reading time |
|---|---|---|
| 1 | The eight primitive types and their literals | 3 min |
| 2 | Reference types, and how they differ | 3 min |
| 3 | Lab: choosing the right types for Movie | 3 min |
🎓 OCP 1Z0-829 candidates: exam traps and practice questions (optional)
Prerequisites: Creating Objects.