Name the wrapper class of (i) char (ii) boolean
Answers
Answered by
1
A wrapper class is a class that contains another class or primitive type. The wrapper class is specifically made so that it provides additional functionality to the wrapped class of primitive type. One example of wrapper classes is with the java.lang.[Integer/Character/Float/etc], which can be used with generics, unlike primitive types.
As another example, imagine I want to add additional functionality to a String. String is final, so I can't extend it. However, I can make a wrapper class:
Similar questions