[Oracle interview]Why do we need wrapper classes?
It issometimes easier to deal with primitives as objects. Moreover most of thecollection classes store objects and not primitive data types. And also thewrapper classes provide many utility methods also. Because of these resons weneed wrapper classes. And since we create instances of these classes we canstore them in any of the collection classes and pass them around as acollection. Also we can pass them around as method parameters where a methodexpects an object.
页:
[1]