P. 1
thinkapjava

thinkapjava

|Views: 53|Likes:
Published by kantti

More info:

Published by: kantti on May 15, 2008
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

10/14/2011

pdf

text

original

For every primitive type in Java, there is a built-in object type called awrapper

class. For example, the wrapper class for int is called Integer; for double it

is called Double.

Wrapper classes are useful for several reasons:

• You can instantiate wrapper classes and create objects that contain prim-

itive values. In other words, you can wrap a primitive value up in an

object, which is useful if you want to invoke a method that requires an

object type.

178

Stacks

• Each wrapper class contains special values (like the minimum and max-

imum values for the type), and methods that are useful for converting

between types.

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->