InterviewSolution
Saved Bookmarks
| 1. |
What is the purpose of a wrapper class? |
|
Answer» The WRAPPER classes wrap the primitive data types to introduce them as objects. The primitive values are not objects and the developer NEEDS to write many boilerplate codes to convert them to each other and using them in collections. To OVERCOME these problems, Java introduced wrapper classes. These classes provide with polymorphic APIS for data type conversions and the utility methods like hashCode() and equals(). These make the values very USEFUL members in the object-oriented environment. |
|