Computer Science, asked by Amrita2282, 10 months ago

what is a wrapper class????!​

Answers

Answered by joelsjm8089
4

Answer:

Explanation:

A Wrapper class is a class whose object wraps or contains a primitive data types.

Answered by kavitasingh1234
0

{\huge{\sf{\red{\underline{\underline{ ÅÑSWËR}}}}}}

wrapper \: class

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:-

data \: type \:  \:  \:  \:  \:  \:  \:  \: wrapper \: class

  1. int Integer
  2. char. Character
  3. short Short
  4. boolean Boolean
  5. long Long
  6. float. Float
  7. double. Double
  8. 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:-

  1. The valueOf()Method
  2. The xxxValue()Method
  3. The parseXxx()Method
  4. The toString()Method

Similar questions