University of Toronto - Fall 2000
Department of Computer Science

Week 9 - Wrapper Classes

Each primitive type corresponds to a wrapper class.

These classes also contain static methods, some of which you've seen:

They also contain non-static methods that can be used to access the value that you've stored in the wrapper class.
Here is an example for the Double wrapper class:

double d = 25.5
Double dWrap = new Double (d);
double d2 = dWrap.doubleValue();

Now we can better understand how String input is converted to a double:

double d = Double.valueOf(in.readLine()).doubleValue();