what is a wrapper class????!
Answers
Answered by
4
Answer:
Explanation:
A Wrapper class is a class whose object wraps or contains a primitive data types.
Answered by
0
Wrapper class are the part of java.lang library which converts the primitive data types into objects.
Here are some of the primitive data type with its wrapper class:-
- int Integer
- char. Character
- short Short
- boolean Boolean
- long Long
- float. Float
- double. Double
- byte. Byte
Example:
Integer I=new Integer(6);
Character c=new Character (f);
Significance use of Wrapping classes:-
- Wrapping class can store more data than primitive data type.
- NOTE: IF WE WANT TO USE MULTIPLE OBJECTS,THAN WE CAN USE THE WRAPPER CLASS.
- To retrieve data in any kind of data structures that support object.
- Wrapper class has function to perform parsing operation so it became very use full for us.
- Wrapper class object allows us to store null values.
Some common method:-
- The valueOf()Method
- The xxxValue()Method
- The parseXxx()Method
- The toString()Method
Similar questions