I keep seeing the following when I look up why use wrapper classes:
Objects are needed if we wish to modify the arguments passed into a method (because primitive types are passed by value).
- if we set the parameter to the return value we can modify the primitive
- everything in java is passed by value
What does the statement actually mean? Can someone provide an example?
I did a search on why use wrapper classes and came up with the following:
https://www.tutorialspoint.com/why-do-we-need-a-wrapper-class-in-java
https://www.geeksforgeeks.org/need-of-wrapper-classes-in-java/
They all say the same thing. Is it just plain wrong or are they trying to say something else?