Está en la página 1de 1

21-3

Likewise, the Wrapper classes for the other numeric types (


methods.

, etc.) have conversion

classes.

1. The classes that convert primitives to objects are called

2. Name the four primitive data types with which wrapper classes primarily deal.
3. Write code that will convert

into a wrapper class object. Call the object

4. Write code that will produce a


inside it).

type wrapper object called

(wrap a

5. Write code that will convert the integer


object
.

into an

wrapper class object. Call the

6. Assume you have the object


character.

. Write code to convert this to a primitive

7. Assume you have


objects and . Show how you would multiply the values
.
stored in these objects and then store the answer in primitive
8. Assume you have
objects and . Show how you would add the values stored
object called .
in these objects and then store the answer in a third

9. Write code that will extract the


statement.
if (

10. Convert the object

) into a primitive

(of type

11. Convert the object (of type


danger of doing this?

wrapped in the

) into a primitive

12. What is the primary purpose of wrapper classes?

and test it with an

called .
called

. What is the

También podría gustarte