🎯 1. What Are Wrapper Classes?

Wrapper classes convert primitive data types into objects.

Primitive β†’ Object

int β†’ Integer

double β†’ Double

char β†’ Character

boolean β†’ Boolean

Why?

Because many Java APIs work only with objects, not primitives.

Examples:

Collections, Generics, Streams, HashMap, ArrayList


⭐ 2. Why Wrapper Classes Exist?

βœ” Allow primitives in collections

βœ” Provide utility methods

βœ” Enable null values (primitives can’t)

βœ” Needed for OOP + frameworks

βœ” Works with Generics (List<Integer> not List<int>)