Wrapper Classes

HowToDoInJava AMP Logo

Java Wrapper Classes, Autoboxing and Unboxing

Learn about Java wrapper classes, their usage, conversion between primitives and objects; and autoboxing and unboxing with examples. 1. Java Wrapper Classes In Java, we have 8 primitive data types. Java provides type wrappers, which are classes that encapsulate a primitive type within an Object. A wrapper class wraps (encloses) around a primitive datatype and …

Java – Internal Caching in Wrapper Classes

1. Object Creation is Expensive We know to create objects in java using the new keyword. A new instance created in Java allocates the memory in the heap, so creating new objects is considered an expensive operation. To avoid this expensive object creation process, many of the frameworks have been …

About Us

HowToDoInJava provides tutorials and how-to guides on Java and related technologies.

It also shares the best practices, algorithms & solutions and frequently asked interview questions.