What are wrapped classes

Wrapped classes are classes that allow primitive types to be accessed as objects.

Showing Answers 1 - 4 of 4 Answers

asvasudevan

  • Apr 3rd, 2007
 

wrapped classes are inmutable. They are all present in the java.lang package. It provides a class for primitive datatypes.

  Was this answer useful?  Yes

tech.abha

  • Feb 3rd, 2009
 

Wrapper classes are classes that are used to make primitive variables into objects, and to make wrapped objects into primitives. int, boolean, double are all primitive data types and their respective wrapper classes are Integer, Boolean, and Double. Wrapper classes are useful in storing primitive data types in higher level data structures such as Stack


  Was this answer useful?  Yes

Djava

  • Aug 10th, 2009
 

Wrapper Classes are like a wrapper over a  resource that is If I have to access a resource I can access it throught that wrapper.

For example:

'java.lang.Integer' is a wrapper class. with resource being primitive type 'int'.

Advantage of using these wrapper class is that we can use lot of utility methods available or created in Wrapper classes to do manipulation on the resource(here in this example 'int').

String str = "55";
Integer.parseInt(str); //using this wrapper class we can parse a string into integer

Integer integer = new Integer("5");       
float floatValue = integer.floatValue();//can convert a integer type to float type byte  type etc.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Answer Question

Click here to Login / Register your free account


 
Send   Reset

 

Related Answered Questions

 

Related Open Questions