Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


What are wrapped classes?

Answers were Sorted based on User's Feedback



What are wrapped classes?..

Answer / niranjanravi

Wrapper classes allow primitive data types to be accessed
as object.
One assigned a value the value of wrapper calsses cann't be
changed.
thay are used to convert value of one data type to another.

Is This Answer Correct ?    17 Yes 1 No

What are wrapped classes?..

Answer / rama krishna dwadasi

There are 8 wrapper classes which are equivalent to 8
primitive data types.

Primitive type Wrapper Class
1. byte Byte
2. short Short
3. int Integer
4. long Long
5. float Float
6. double Double
7. char Character
8. boolean Boolean

Wrapper classes are useful in the following ways:-
1. Wrapper classes are used to convert one data type to
another data type. For example:- converting int to double,
double to float, float to String, String to float etc.
2. We can convert primitive to objects and objects to
primitive. For example:- In collections we cannot store
primitive values and we have to store only objects.

Note: All primitive types can be converted to String and
corresponding Wrapper objects.

Following are the general conversions we generally do.
1. primitive to wrapper. (int to Integer).
2. one primitive to another primitive type.(int to float).
3. primitive to String. (int to String).
4. wrapper to primitive.(Integer to int)
5. wrapper to String.(Integer to String)
6. String to primitive.(String to int)
7. String to wrapper.(String to Integer)

1Q: How to convert primitives to wrapper objects?
A: 1) By using the corresponding constructor.
2) By using valueOf(primitive type) method

//Program to convert primitive to wrapper object

// 1) By using constructor
//2) By using valueOf() method

// to convert to int to wrapper object
int i = 10;
Integer x = new Integer(i);
Integer p = Integer.valueOf(i);

//to convert double to wrapper object
double d = 99.99;
Double y = new Double(d);
Double q = Double.valueOf(d);

//to convert boolean to wrapper object
boolean b = true;
Boolean z = new Boolean(b);
Boolean r = Boolean.valueOf(b);

Is This Answer Correct ?    7 Yes 0 No

What are wrapped classes?..

Answer / thara

Primitive types are not objects in Java
Many methods are available in the Java library that work
only for objects
Wrapper classes are used to represent primitive data types
as objects.
Boolean, Character, Byte, Short, Integer, Long, Float, and
Double.
Object wrappers for the corresponding native data type.
Object Oriented implementation of the primitive data types

Is This Answer Correct ?    7 Yes 1 No

What are wrapped classes?..

Answer / divya

Wrapping is the process of converting primitive data type
into objects,the Java API provide a set of classes that
make the process easier ,such classes are called Wrapper
classes.The classes which helps for wrapping is called
Wrapped classes.

Is This Answer Correct ?    7 Yes 2 No

What are wrapped classes?..

Answer / ruban

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

Is This Answer Correct ?    5 Yes 0 No

What are wrapped classes?..

Answer / prasad

wrapper class is nothing but converting primtivedatatype
into objects

Is This Answer Correct ?    5 Yes 1 No

What are wrapped classes?..

Answer / ravikiran

wrapper classes will allow us to make use of primitive
datatypes as objects

Is This Answer Correct ?    5 Yes 1 No

Post New Answer

More Core Java Interview Questions

Which java ide is used the most?

0 Answers  


What languages are pass by reference?

0 Answers  


What is singleton service?

0 Answers  


What is console based application in java?

0 Answers  


public class AboutStrings{ public static void main(String args[]){ String s1="hello"; String s2="hel"; String s3="lo"; String s4=s2+s3; //to know the hash codes of s1,s4. System.out.println(s1.hashCode()); System.out.println(s4.hashCode()); // these two s1 and s4 are having same hashcodes. if(s1==s4){ System.out.println("s1 and s4 are same."); }else System.out.println("s1 and s4 are not same."); } } Somebody told me that, == operator compares references of the objects. In the above example even though s1 and s4 are refering to same object(having same hash codes), it is printing s1 and s4 are not same. Can anybody explain in detail why it is behaving like this? Thanks in Advance RavuriVinod

4 Answers   TCS,


Is there is any difference between a scrollbar and a scrollpane?

0 Answers  


what is custom tags with example?

3 Answers   Amdocs,


What does it mean that strings are immutable?

0 Answers  


Is java supports multiple inheritance? explain?

12 Answers   BUET, Inforica,


Which sort is best in java?

0 Answers  


What do you mean by Remote procedure call?

2 Answers  


What does three dots mean in java?

0 Answers  


Categories