Wrapper Classes in Java


Java is not purely object-oriented because it uses primitive data types (int, float, char, etc.). But sometimes, we need these primitives to act like objects—for example, when working with Collections (like ArrayList, HashMap) that only store objects.

This is where Wrapper Classes come in. They wrap primitive types into...