Re: What is wrapper class? Thx.# Java - 爪哇娇娃
m*e
1 楼
First, sometimes you will need to store some values in
data structure such as Set and List, which need Objects
to be stored in. You can not add primitive value into
them. So you have to wrap the primitive value.
Second, wrapper classes also provide us many uselful
methods, such as converting String input of numbers to
numbers. You are certainly going to use one or two such
methods when you get user input from a TextField.