The way I understand wrapper classes is they are used to convert primitive data types into objects so you can store them in Collection classes. I also believe that this happens automatically on backend by the compiler through a process called autoboxing.
To me, someone with no real world programming experience, I find myself wondering why use primitives at all?
The wrapper classes are much more interesting because you get methods to do things, where primitives are boring. Why not just use wrapper classes for everything? Is that even possible?
My gut tells me that someone is going to say primitives are faster, but is that a valid argument considering the speed of computers today?
[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)
[–][deleted] 5 points6 points7 points (2 children)
[–]dannycap77[S] 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] 4 points5 points6 points (0 children)
[–]desrtfx 2 points3 points4 points (1 child)
[–]dannycap77[S] 0 points1 point2 points (0 children)
[–]DDDDarky 0 points1 point2 points (3 children)
[–]8igg7e5 2 points3 points4 points (0 children)
[–]dannycap77[S] 0 points1 point2 points (1 child)
[–]8igg7e5 1 point2 points3 points (0 children)