© Kishori Sharan and Adam L. Davis 2022
K. Sharan, A. L. DavisBeginning Java 17 Fundamentalshttps://doi.org/10.1007/978-1-4842-7307-4_12

12. Wrapper Classes

Kishori Sharan1   and Adam L. Davis2
(1)
Montgomery, AL, USA
(2)
Oviedo, FL, USA
 
In this chapter, you will learn:
  • The wrapper classes in Java and how to use them

  • How to get primitive values from strings

  • How primitive values are automatically boxed into wrapper objects when needed

  • How wrapper objects are automatically unboxed into primitive values when needed

All classes in this chapter are a member of a jdojo.wrapper module, as declared in Listing 12-1.
// module-info.java
module jdojo.wrapper {
    exports com.jdojo.wrapper;
}
Listing 12-1

The Declaration of a jdojo.wrapper Module

Wrapper Classes

In previous ...

Get Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.