Please enable JavaScript to use CodeHS

Chapter 2

Using Objects

2.8 Wrapper Classes: Integers and Doubles

Wrapper Classes

Creating Integer and Double Objects

Autoboxing and Unboxing

Autoboxing Example

Methods in the Integer and Double Class

Method Examples

Creating Integers

Using Doubles

Check Your Understanding

  1. Incorrect Correct No Answer was selected Invalid Answer

Exercise: Guess the number!