Java Primitive Types and Objects Cheat Sheet
The core ideas of Java Primitive Types and Objects distilled into a single, scannable reference — perfect for review or quick lookup.
Quick Reference
Primitive Data Types
Eight types: int (32-bit), double (64-bit float), boolean (true/false), char (16-bit Unicode), byte, short, long, float. Store values directly in memory.
Reference Types and Objects
Store memory addresses pointing to heap objects. Can hold null. Assignment copies the reference, not the object.
The String Class
Immutable character sequence. Methods: length(), substring(), indexOf(), equals(), compareTo(). Modification returns new Strings.
Type Casting
Widening (int to double) is automatic. Narrowing (double to int) requires explicit cast and truncates.
The Math Class
Static methods: abs(), pow(), sqrt(), random()[0.0,1.0), min(), max().
Integer Division and Modulus
Both int operands: truncates decimal. Modulus (%) returns remainder.
Autoboxing and Unboxing
Auto-conversion between primitives and wrappers (int/Integer). Enables primitives in ArrayList.
Key Terms at a Glance
Get study tips in your inbox
We'll send you evidence-based study strategies and new cheat sheets as they're published.
We'll notify you about updates. No spam, unsubscribe anytime.