Java Programming
It may be converted into object types by using the Wrapper classes.
As the name says, 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.
Wrapper Classes
As we know that, Collection cannot handle primitive data types.It may be converted into object types by using the Wrapper classes.
As the name says, 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.
Comments