1. Wrapper Classes.
- Wrapper classes increase the speed of programs by optimizing primitive operations.
- Incorrect: Wrapper classes result in slower speeds due to the additional overhead from managing Objects instead of primitives and boxing/unboxing.
- Wrapper classes turn primitive data types into Objects.
- Correct!
- Wrapper classes increase the precision of mathematical calculations.
- Incorrect: Wrapper classes do not provide any increased precision in calculations. The precision of a calculation depends on the type (ex.
float
is more precise than anint
), not by whether the data is in its primitive form or Object/Wrapper class form.
What is the primary purpose of Wrapper classes in Java?