
what is wrapper class in java and why we use it

Hi Friend,
Wrapper class is a wrapper around a primitive data type. It represents primitive data types in their corresponding class instances e.g. a boolean data type can be represented as a Boolean class instance. All of the primitive wrapper classes in Java are immutable i.e. once assigned a value to a wrapper class instance cannot be changed further.
For more information, visit the following link:
Thanks

Hi Friend,
Wrapper class is a wrapper around a primitive data type. It represents primitive data types in their corresponding class instances e.g. a boolean data type can be represented as a Boolean class instance. All of the primitive wrapper classes in Java are immutable i.e. once assigned a value to a wrapper class instance cannot be changed further.
For more information, visit the following link:
Thanks

for each and every predefined fundamental data type there exist a predefined class called wrapper class.it is used for converting string data into fundamental data.
for int-Integer float-Float char-Character etc. and there is a method present in each Wrapper class called public static XXX parseXXX(String) which is used for converting into fundamental. XXX represent fundamental data type.
example: if we entering 10 through cmd then it is treated as String.so converting into int we should use int x=Integer.parseInt(10);
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.