About Wrapper Classes ...
I am really disappointed over this thing.
If everything in Java is classes, why have separate wrapper classes for the built-in data types? Why not embed the functionality in the int, float etc.?
The only possible reason I can think up of is that these intrinsic data types are really not implemented as classes, and so when they need to be used as objects, the wrapper classes are used.
Is there any other explanation? I have learnt only one use for the wrapper classes so far, and that is to change the type of a value from an intrinsic data type to an object.
.
Re: About Wrapper Classes ...
Quote:
Originally posted by honeybee
I am really disappointed over this thing.
If everything in Java is classes, why have separate wrapper classes for the built-in data types? Why not embed the functionality in the int, float etc.?
The only possible reason I can think up of is that these intrinsic data types are really not implemented as classes, and so when they need to be used as objects, the wrapper classes are used.
Is there any other explanation? I have learnt only one use for the wrapper classes so far, and that is to change the type of a value from an intrinsic data type to an object.
.
int, float, etc. are keywords. Integer, Float, etc. are classes with more functionality than the primitive data types.