Wrapper Classes in Java | Java Tutorial For Beginners | Autoboxing | Auto Unboxing with Example

#Java provides type wrappers, which are classes that #encapsulate a primitive type within an object.

A #wrapperclass wraps (encloses) around a data type and gives it an object appearance. Whatever, the data type is required as an object, this object can be used. Wrapper classes include methods to unwrap the object and give back the data type.

Uses of #WrapperClasses:

When 2 methods wants to refer to the same instance of primitive type, then pass wrapper class as method argument.
Generics in Java works only with object and does not support primitive types.
Collections in Java deal only with objects, to store a primitive type in one of these classes, you need to wrap the primitive type in a class.
When you want to refer null from data type, you need an object. Primitives can not have null as value.

Java Tutorial For Basics - https://bit.ly/3zZw25Q
Protractor with Javascript - https://bit.ly/2jZ5XkX
Selenium Java Tutorial - https://bit.ly/2keM2Pb
Jasmine Tutorial - https://bit.ly/2lv0m6l
Java - https://bit.ly/2lylSHq
TestNG Tutorial - https://bit.ly/2lTpB2d
PdfUtil - https://bit.ly/2keBDTA
Shutterbug - https://bit.ly/2lX6xQV
Selenium Realtime Examples - https://bit.ly/2k0FqDQ
Java Interview Questions - https://bit.ly/2kopsmY
Katalon Studio - https://bit.ly/2lWhyln
Database Testing - https://bit.ly/2ko4jcJ
Fillo Excel API - https://bit.ly/2jRyWqC
Ashot - https://bit.ly/2kqXk2y
Extent Reports Version 3 Java - https://bit.ly/2k0FweG
Robot class - https://bit.ly/2lshPfJ
Sikuli - https://bit.ly/2lTq2cR
Excel Read Write using Java - https://bit.ly/2lyXRj8
AutoIt - https://bit.ly/2lyIYgM
Extent Reports Version 2 C# - https://bit.ly/2kqIY2d
Extent Reports Version 2 Java - https://bit.ly/2k0XkGA

Facebook : https://www.facebook.com/automationtesting2016/
LinkedIn : https://www.linkedin.com/feed/?trk=hb_signin
Google+ : https://plus.google.com/105286300926085335367
Twitter : https://twitter.com/krishnasakinala
Website : http://automationtesting.in/
Be the first to comment