+ 4

Wt is wrapper class in java

25th Mar 2021, 5:25 AM
radhika
radhika - avatar
6 Answers
+ 6
The wrapper classes in Java are used to convert primitive types (int, char, float, etc) into corresponding objects. This process is known as boxing. Each of the 8 primitive types has corresponding wrapper classes. In Java, sometimes we might need to use objects instead of primitive data types such as in collections. You can also store null value in a wrapper. Note: Primitive types are more efficient than corresponding objects. Hence, when efficiency is the requirement, it is always recommended primitive types.
25th Mar 2021, 5:53 AM
Soumik
Soumik - avatar
+ 2
what do you mean? What language are you talking about? It‘s not clear if you mean class as in an object oriented language or a class in e.g. css
25th Mar 2021, 5:36 AM
John Doe
+ 2
As soumic said it well , on convertion from primitive types to corresponding objects eg. is Integer class i posted a question yesterday , in Addition also the wrapper class may convert the objects into primitive types. https://www.sololearn.com/Discuss/2735097/?ref=app
25th Mar 2021, 8:39 AM
Ona Nixon đŸ‡č🇿 👑
Ona Nixon  đŸ‡č🇿  👑 - avatar
0
In java
25th Mar 2021, 5:39 AM
radhika
radhika - avatar
0
//generally class SomeClass {} class Wrapp { SomeClass c; }
25th Mar 2021, 8:19 AM
zemiak