Series: Subject: Topic:
Question: 2085 of 2110

What are wrapped classes

Wrapped classes are classes that allow primitive types to be accessed as objects.
Asked by: Interview Candidate | Asked on: Aug 25th, 2004
Showing Answers 1 - 4 of 4 Answers

Answered On : Apr 3rd, 2007

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

Login to rate this answer.

Wrapped classes are used to Primative data types as an Object.EX: int val1; val=10;        val=new Integer();

Login to rate this answer.

Answered On : Feb 3rd, 2009

View all answers by tech.abha

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

Login to rate this answer.

Answered On : Aug 10th, 2009

View all answers by Djava

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 integerInteger integer = new Integer("5");        float floatValue = integer.floatValue();//can convert a integer type to float type byte  type etc.

Yes  2 Users have rated as useful.
Login to rate this answer.

Give your answer:

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

Related Open Questions



twitter fb Linkedin GPlus RSS


Interview Question

 Ask Interview Question?


Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.