Question
What are wrapper classes?
Answer
-
Wrapper classes are used to convert any data type into an object.?
-
The primitive data types are not objects; they do not belong to any class; they are defined in the language itself.?
-
Sometimes, it is required to convert data types into objects in Java language.?
-
A wrapper class wraps (encloses) around a data type and gives it an object appearance. Wherever, the data type is required as an object, this object can be used.?
-
Wrapper classes include methods to unwrap the object and give back the data type.