{"id":12776,"date":"2023-02-13T07:12:33","date_gmt":"2023-02-13T07:12:33","guid":{"rendered":"https:\/\/www.prepbytes.com\/blog\/?p=12776"},"modified":"2023-10-16T07:12:31","modified_gmt":"2023-10-16T07:12:31","slug":"wrapper-class-in-java","status":"publish","type":"post","link":"https:\/\/prepbytes.com\/blog\/wrapper-class-in-java\/","title":{"rendered":"Wrapper Class in Java"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1676272279952-Wrapper%20Class%20in%20Java.jpg\" alt=\"\" \/><\/p>\n<p>In Java, primitive data types like int, char, and float are simple and efficient for basic data storage, but they lack the flexibility to work with objects and perform certain operations. To bridge this gap between primitive types and objects, Java provides a set of wrapper classes. Wrapper classes are a group of classes that encapsulate primitive data types, allowing them to be treated as objects.<br \/>\nIn this article, we&#8217;ll explore the concept of wrapper classes in Java. We&#8217;ll discuss why and when you should use wrapper classes, how to create instances of wrapper classes, and the various methods they provide for converting between primitive types and objects. Understanding wrapper classes is crucial for working with collections, generics, and other Java features that require objects instead of primitives.<\/p>\n<h2>What is a Wrapper Class in Java?<\/h2>\n<p>A Wrapper class in Java is a class that wraps around a primitive data type and converts it into an object. Wrapper classes provide a way to treat primitive data types, such as int or double, as objects. This allows you to use the primitive data types in places where only objects are accepted, such as in collections. The eight primitive data types (boolean, char, byte, short, int, long, float, and double) in Java are not objects, but the wrapper classes (Boolean, Character, Byte, Short, Integer, Long, Float, and Double) are.<\/p>\n<p>Each Wrapper class in java has a constructor that takes a single argument of the corresponding primitive data type. For example, you can use the Integer class to convert an int value into an Integer object:<\/p>\n<pre><code>int i = 42;\nInteger iWrapped = new Integer(i);<\/code><\/pre>\n<p>Wrapper classes also provide utility methods for converting primitive values to and from binary and hexadecimal representations:<\/p>\n<pre><code>int i = 42;\nString binary = Integer.toBinaryString(i);\nString hex = Integer.toHexString(i);<\/code><\/pre>\n<p>Another important aspect of Wrapper classes is the ability to use them in place of primitive data types in collections, such as arrays and lists. Since the primitive data types are not objects, they cannot be directly stored in collections. The Wrapper classes provide a way to store primitive values as objects:<\/p>\n<pre><code>List list = new ArrayList();\nlist.add(42);<\/code><\/pre>\n<p>The Wrapper classes also provide methods for comparing and manipulating the values they contain. For example, the Integer class provides methods for comparing two Integer objects, such as compareTo(), equals(), and compare():<\/p>\n<pre><code>Integer i1 = 42;\nInteger i2 = 43;\nint result = i1.compareTo(i2);<\/code><\/pre>\n<p>And the Character class provides methods for testing the type of characters and converting them to uppercase or lowercase:<\/p>\n<pre><code>Character c = 'a';\nboolean isLowerCase = Character.isLowerCase(c);\nchar upperCase = Character.toUpperCase(c);<\/code><\/pre>\n<p>Wrapper classes also provide support for autoboxing and unboxing, which allows you to use primitive data types and Wrapper objects interchangeably. Autoboxing is the process of converting a primitive value into an object of the corresponding Wrapper class in java automatically, while unboxing is the process of converting a Wrapper object back into a primitive value. This makes it possible to use Wrapper objects and primitive values interchangeably in your code:<\/p>\n<pre><code>int i = 42;\nInteger iWrapped = i; \/\/ Autoboxing\nint j = iWrapped; \/\/ Unboxing<\/code><\/pre>\n<p>Summarising Wrapper class in java provides a way to treat primitive data types as objects in Java. They provide a set of utility methods for converting, comparing, and manipulating primitive values, and are particularly useful for working<\/p>\n<h3>Need of Wrapper Class in Java<\/h3>\n<p>Wrapper classes in Java are used to wrap primitive data types (such as int, char, and boolean) in an object. This is necessary because in Java, everything is an object, and objects are required in certain situations, such as when a method requires an object as a parameter or when you need to store multiple values in a single structure like an ArrayList or a HashMap.<\/p>\n<p>Each primitive data type has a corresponding wrapper class: Integer for int, Character for char, Boolean for boolean, etc. Wrapper classes provide useful methods for converting primitive values to and from strings, comparing values, and performing other operations.<\/p>\n<p>For example, the Integer class has a static method called parseInt that can be used to convert a string representation of an integer into an int value, and the toString method can be used to convert an int value into a string. This can be particularly useful when reading data from a file or user input.<\/p>\n<p>Another benefit of using wrapper classes is that they provide an easy way to represent null values. When a primitive value is set to its default value (such as 0 for int or false for boolean), it is unclear whether the value was explicitly set to that default or if it has not been initialized. By using a wrapper class, you can set a reference to null, which makes it clear that the value has not been initialized.<\/p>\n<p>Wrapper classes also allow you to use primitive data types in collections, such as ArrayList, where only objects can be stored. By wrapping the primitive value in an object, you can store it in the collection.<\/p>\n<p>In conclusion, the wrapper classes in Java serve a crucial purpose in providing a way to represent primitive data types as objects. They offer a convenient way to perform various operations on primitive values and also provide a way to store null values and use primitive data types in collections.<\/p>\n<p>In Java, the eight classes that make up the java.lang package are referred to as wrapper classes. Following is a list of the eight wrapper classes:<\/p>\n<table>\n<thead>\n<tr>\n<th>Primitive Type<\/th>\n<th>Wrapper Class<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>char<\/td>\n<td>Character<\/td>\n<\/tr>\n<tr>\n<td>short<\/td>\n<td>Short<\/td>\n<\/tr>\n<tr>\n<td>long<\/td>\n<td>Long<\/td>\n<\/tr>\n<tr>\n<td>double<\/td>\n<td>Double<\/td>\n<\/tr>\n<tr>\n<td>boolean<\/td>\n<td>Boolean<\/td>\n<\/tr>\n<tr>\n<td>byte<\/td>\n<td>Byte<\/td>\n<\/tr>\n<tr>\n<td>int<\/td>\n<td>Integer<\/td>\n<\/tr>\n<tr>\n<td>float<\/td>\n<td>Float<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Uses of Wrapper Class in Java<\/h2>\n<p>The main uses of the wrapper class in Java are<\/p>\n<ul>\n<li><strong>Representing primitive data types as objects:<\/strong> Wrapper classes provide a way to use primitive data types as objects, which is necessary in certain situations where only objects are accepted, such as in collections like ArrayList and HashMap.<\/li>\n<li><strong>Storing null values:<\/strong> Primitive data types in Java cannot store null values, but wrapper classes can be set to null, which can be useful in representing missing or unknown values.<\/li>\n<li><strong>Method parameters:<\/strong> Wrapper classes can be used as method parameters, allowing methods to accept objects instead of primitive data types.<\/li>\n<li><strong>Autoboxing and unboxing:<\/strong> Wrapper classes provide automatic conversions between primitive data types and their corresponding wrapper objects through a feature called autoboxing and unboxing.<\/li>\n<li><strong>Converting between primitive data types and strings:<\/strong> Wrapper classes provide methods for converting primitive values to and from strings, which can be useful for reading data from a file or user input.<\/li>\n<li><strong>Comparing values:<\/strong> Wrapper classes provide methods for comparing values, such as equals() and compareTo(), which can be useful for sorting and searching.<\/li>\n<li><strong>Performing mathematical operations:<\/strong> Wrapper classes provide methods for performing mathematical operations, such as addition, subtraction, and multiplication, on primitive values.<\/li>\n<\/ul>\n<h2>Autoboxing in Java<\/h2>\n<p>Autoboxing in Java refers to the automatic conversion of primitive data types to their corresponding wrapper classes. This feature was introduced in Java 5 and makes it easier to use primitive values in situations where only objects are accepted, such as in collections and method parameters.<br \/>\nPrior to Java 5, converting a primitive value to its corresponding wrapper class in java required manual conversion, using the constructor of the wrapper class.<\/p>\n<h3>Example of Autoboxing<\/h3>\n<p>Here we will look at the example of autoboxing in the wrapper class in java<\/p>\n<p><strong>Code:<\/strong><\/p>\n\t\t\t\t\t\t<style>\r\n\t\t\t\t\r\n\t\t\t\t\t#tab_container_12540 {\r\n\toverflow:hidden;\r\n\tdisplay:block;\r\n\twidth:100%;\r\n\tborder:0px solid #ddd;\r\n\tmargin-bottom:30px;\r\n\t}\r\n\r\n#tab_container_12540 .tab-content{\r\n\tpadding:20px;\r\n\tborder: 1px solid #e6e6e6 !important;\r\n\tmargin-top: 0px;\r\n\tbackground-color:#ffffff !important;\r\n\tcolor: #000000 !important;\r\n\tfont-size:16px !important;\r\n\tfont-family: Open Sans !important;\r\n\t\r\n\t\tborder: 1px solid #e6e6e6 !important;\r\n\t}\r\n#tab_container_12540 .wpsm_nav-tabs {\r\n    border-bottom: 0px solid #ddd;\r\n}\r\n#tab_container_12540 .wpsm_nav-tabs > li.active > a, #tab_container_12540 .wpsm_nav-tabs > li.active > a:hover, #tab_container_12540 .wpsm_nav-tabs > li.active > a:focus {\r\n\tcolor: #000000 !important;\r\n\tcursor: default;\r\n\tbackground-color: #ffffff !important;\r\n\tborder: 1px solid #e6e6e6 !important;\r\n}\r\n\r\n#tab_container_12540 .wpsm_nav-tabs > li > a {\r\n    margin-right: 0px !important; \r\n    line-height: 1.42857143 !important;\r\n    border: 1px solid #d5d5d5 !important;\r\n    border-radius: 0px 0px 0 0 !important; \r\n\tbackground-color: #e8e8e8 !important;\r\n\tcolor: #000000 !important;\r\n\tpadding: 15px 18px 15px 18px !important;\r\n\ttext-decoration: none !important;\r\n\tfont-size: 14px !important;\r\n\ttext-align:center !important;\r\n\tfont-family: Open Sans !important;\r\n}\r\n#tab_container_12540 .wpsm_nav-tabs > li > a:focus {\r\noutline: 0px !important;\r\n}\r\n\r\n#tab_container_12540 .wpsm_nav-tabs > li > a:before {\r\n\tdisplay:none !important;\r\n}\r\n#tab_container_12540 .wpsm_nav-tabs > li > a:after {\r\n\tdisplay:none !important ;\r\n}\r\n#tab_container_12540 .wpsm_nav-tabs > li{\r\npadding:0px !important ;\r\nmargin:0px;\r\n}\r\n\r\n#tab_container_12540 .wpsm_nav-tabs > li > a:hover , #tab_container_12540 .wpsm_nav-tabs > li > a:focus {\r\n    color: #000000 !important;\r\n    background-color: #e8e8e8 !important;\r\n\tborder: 1px solid #d5d5d5 !important;\r\n\t\r\n}\r\n#tab_container_12540 .wpsm_nav-tabs > li > a .fa{\r\n\r\nmargin-right:5px !important;\r\n\r\nmargin-left:5px !important;\r\n\r\n\r\n}\r\n\r\n\t\t#tab_container_12540 .wpsm_nav-tabs a{\r\n\t\t\tbackground-image: none;\r\n\t\t\tbackground-position: 0 0;\r\n\t\t\tbackground-repeat: repeat-x;\r\n\t\t}\r\n\t\t\t\r\n\r\n\r\n#tab_container_12540 .wpsm_nav-tabs > li {\r\n    float: left;\r\n    margin-bottom: -1px !important;\r\n\tmargin-right:0px !important; \r\n}\r\n\r\n\r\n#tab_container_12540 .tab-content{\r\noverflow:hidden !important;\r\n}\r\n\r\n\r\n@media (min-width: 769px) {\r\n\r\n\t#tab_container_12540 .wpsm_nav-tabs > li{\r\n\t\tfloat:left !important ;\r\n\t\t\t\tmargin-right:-1px !important;\r\n\t\t\t\t\t}\r\n\t#tab_container_12540 .wpsm_nav-tabs{\r\n\t\tfloat:none !important;\r\n\t\tmargin:0px !important;\r\n\t}\r\n\r\n\t#tab_container_12540 .wpsm_nav-tabs > li {\r\n\t\t\t\t\r\n\t}\r\n\t#tab_container_12540 .wpsm_nav{\r\n\t\t\t}\r\n\r\n}\r\n\r\n\r\n\r\n@media (max-width: 768px) {\r\n\t#tab_container_12540 .wpsm_nav-tabs > li {\r\n\t\t\t\t\r\n\t}\r\n\t#tab_container_12540 .wpsm_nav{\r\n\t\t\t}\r\n}\r\n\r\n\r\n\t.wpsm_nav-tabs li:before{\r\n\t\tdisplay:none !important;\r\n\t}\r\n\r\n\t@media (max-width: 768px) {\r\n\t\t\t\t\r\n\t\t\t\t.wpsm_nav-tabs{\r\n\t\t\tmargin-left:0px !important;\r\n\t\t\tmargin-right:0px !important; \r\n\t\t\t\r\n\t\t}\r\n\t\t\t\t#tab_container_12540 .wpsm_nav-tabs > li{\r\n\t\t\tfloat:none !important;\r\n\t\t}\r\n\t\t\t\r\n\t}\t\t\t\t<\/style>\r\n\t\t\t\t<div id=\"tab_container_12540\" >\r\n\t \r\n\t\t\t\t\t<ul class=\"wpsm_nav wpsm_nav-tabs\" role=\"tablist\" id=\"myTab_12540\">\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t<li role=\"presentation\"  class=\"active\"  onclick=\"do_resize()\">\r\n\t\t\t\t\t\t\t\t<a href=\"#tabs_desc_12540_1\" aria-controls=\"tabs_desc_12540_1\" role=\"tab\" data-toggle=\"tab\">\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<i class=\"fa fa-code\"><\/i> \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t<span>Java<\/span>\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t<\/a>\r\n\t\t\t\t\t\t\t<\/li>\r\n\t\t\t\t\t\t\t\t\t\t\t <\/ul>\r\n\r\n\t\t\t\t\t  <!-- Tab panes -->\r\n\t\t\t\t\t  <div class=\"tab-content\" id=\"tab-content_12540\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t <div role=\"tabpanel\" class=\"tab-pane  in active \" id=\"tabs_desc_12540_1\">\r\n\t\t\t\t\t\t\t\t<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\">import java.util.*;\r\nimport java.lang.*;\r\nimport java.io.*;\r\n\r\n\r\n class WrapperExample1{  \r\npublic static void main(String args[]){  \r\n\/\/Converting int into Integer  \r\nint a=22;  \r\nInteger i=Integer.valueOf(a);\r\nInteger j=a;\r\n  \r\nSystem.out.println(a+\" \"+i+\" \"+j);  \r\n}}<\/pre>\t\t\t\t\t\t <\/div>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t <\/div>\r\n\t\t\t\t\t \r\n\t\t\t\t <\/div>\r\n <script>\r\n\t\tjQuery(function () {\r\n\t\t\tjQuery('#myTab_12540 a:first').tab('show')\r\n\t\t});\r\n\t\t\r\n\t\t\t\tjQuery(function(){\r\n\t\t\tvar b=\"fadeIn\";\r\n\t\t\tvar c;\r\n\t\t\tvar a;\r\n\t\t\td(jQuery(\"#myTab_12540 a\"),jQuery(\"#tab-content_12540\"));function d(e,f,g){\r\n\t\t\t\te.click(function(i){\r\n\t\t\t\t\ti.preventDefault();\r\n\t\t\t\t\tjQuery(this).tab(\"show\");\r\n\t\t\t\t\tvar h=jQuery(this).data(\"easein\");\r\n\t\t\t\t\tif(c){c.removeClass(a);}\r\n\t\t\t\t\tif(h){f.find(\"div.active\").addClass(\"animated \"+h);a=h;}\r\n\t\t\t\t\telse{if(g){f.find(\"div.active\").addClass(\"animated \"+g);a=g;}else{f.find(\"div.active\").addClass(\"animated \"+b);a=b;}}c=f.find(\"div.active\");\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\r\n\t\tfunction do_resize(){\r\n\r\n\t\t\tvar width=jQuery( '.tab-content .tab-pane iframe' ).width();\r\n\t\t\tvar height=jQuery( '.tab-content .tab-pane iframe' ).height();\r\n\r\n\t\t\tvar toggleSize = true;\r\n\t\t\tjQuery('iframe').animate({\r\n\t\t\t    width: toggleSize ? width : 640,\r\n\t\t\t    height: toggleSize ? height : 360\r\n\t\t\t  }, 250);\r\n\r\n\t\t\t  toggleSize = !toggleSize;\r\n\t\t}\r\n\r\n\r\n\t<\/script>\r\n\t\t\t\t\r\n\t\t\t\n<p><strong>Output<\/strong><\/p>\n<pre><code>22 22 22<\/code><\/pre>\n<p><strong>Explanation of the above example<\/strong><br \/>\nIn the above example we have converted the int which is a primitive data type into Integer using wrapper class in java.<\/p>\n<p><strong>Autoboxing is performed automatically in the following situations:<\/strong><\/p>\n<ul>\n<li>When assigning a primitive value to a variable of its corresponding wrapper class.<\/li>\n<li>When passing a primitive value as an argument to a method that requires an object of the corresponding wrapper class.<\/li>\n<li>When storing a primitive value in a collection that requires objects, such as an ArrayList or a HashMap.<\/li>\n<\/ul>\n<p>Autoboxing has several benefits, including improved code readability, reduced code verbosity, and easier use of primitive values in situations where only objects are accepted.<\/p>\n<p>It is important to note that autoboxing is performed only for the primitive data types and their corresponding wrapper classes defined in the java.lang package: boolean and Boolean, char and Character, byte and Byte, short and Short, int and Integer, long and Long, float and Float, and double and Double.<\/p>\n<h2>Unboxing in Java<\/h2>\n<p>In Java, wrapper classes are used to wrap primitive data types such as int, char, etc. into objects. This is useful when working with collections, where only objects can be stored, not primitive data types. The wrapper classes also provide additional methods that can be useful in processing the wrapped data. The process of converting a wrapper class in java\u2019s object back into its corresponding primitive data type is called &quot;unboxing.&quot;<\/p>\n<p>To unbox a wrapper class object, the valueOf() method is used. The valueOf() method takes a String as a parameter and returns an object of the corresponding wrapper class. <\/p>\n<h3>Example of Unboxing<\/h3>\n<p>Unboxing is the opposite of autoboxing as here we will convert the class into a primitive data type.<\/p>\n<p><strong>Code:<\/strong><\/p>\n\t\t\t\t\t\t<style>\r\n\t\t\t\t\r\n\t\t\t\t\t#tab_container_12541 {\r\n\toverflow:hidden;\r\n\tdisplay:block;\r\n\twidth:100%;\r\n\tborder:0px solid #ddd;\r\n\tmargin-bottom:30px;\r\n\t}\r\n\r\n#tab_container_12541 .tab-content{\r\n\tpadding:20px;\r\n\tborder: 1px solid #e6e6e6 !important;\r\n\tmargin-top: 0px;\r\n\tbackground-color:#ffffff !important;\r\n\tcolor: #000000 !important;\r\n\tfont-size:16px !important;\r\n\tfont-family: Open Sans !important;\r\n\t\r\n\t\tborder: 1px solid #e6e6e6 !important;\r\n\t}\r\n#tab_container_12541 .wpsm_nav-tabs {\r\n    border-bottom: 0px solid #ddd;\r\n}\r\n#tab_container_12541 .wpsm_nav-tabs > li.active > a, #tab_container_12541 .wpsm_nav-tabs > li.active > a:hover, #tab_container_12541 .wpsm_nav-tabs > li.active > a:focus {\r\n\tcolor: #000000 !important;\r\n\tcursor: default;\r\n\tbackground-color: #ffffff !important;\r\n\tborder: 1px solid #e6e6e6 !important;\r\n}\r\n\r\n#tab_container_12541 .wpsm_nav-tabs > li > a {\r\n    margin-right: 0px !important; \r\n    line-height: 1.42857143 !important;\r\n    border: 1px solid #d5d5d5 !important;\r\n    border-radius: 0px 0px 0 0 !important; \r\n\tbackground-color: #e8e8e8 !important;\r\n\tcolor: #000000 !important;\r\n\tpadding: 15px 18px 15px 18px !important;\r\n\ttext-decoration: none !important;\r\n\tfont-size: 14px !important;\r\n\ttext-align:center !important;\r\n\tfont-family: Open Sans !important;\r\n}\r\n#tab_container_12541 .wpsm_nav-tabs > li > a:focus {\r\noutline: 0px !important;\r\n}\r\n\r\n#tab_container_12541 .wpsm_nav-tabs > li > a:before {\r\n\tdisplay:none !important;\r\n}\r\n#tab_container_12541 .wpsm_nav-tabs > li > a:after {\r\n\tdisplay:none !important ;\r\n}\r\n#tab_container_12541 .wpsm_nav-tabs > li{\r\npadding:0px !important ;\r\nmargin:0px;\r\n}\r\n\r\n#tab_container_12541 .wpsm_nav-tabs > li > a:hover , #tab_container_12541 .wpsm_nav-tabs > li > a:focus {\r\n    color: #000000 !important;\r\n    background-color: #e8e8e8 !important;\r\n\tborder: 1px solid #d5d5d5 !important;\r\n\t\r\n}\r\n#tab_container_12541 .wpsm_nav-tabs > li > a .fa{\r\n\r\nmargin-right:5px !important;\r\n\r\nmargin-left:5px !important;\r\n\r\n\r\n}\r\n\r\n\t\t#tab_container_12541 .wpsm_nav-tabs a{\r\n\t\t\tbackground-image: none;\r\n\t\t\tbackground-position: 0 0;\r\n\t\t\tbackground-repeat: repeat-x;\r\n\t\t}\r\n\t\t\t\r\n\r\n\r\n#tab_container_12541 .wpsm_nav-tabs > li {\r\n    float: left;\r\n    margin-bottom: -1px !important;\r\n\tmargin-right:0px !important; \r\n}\r\n\r\n\r\n#tab_container_12541 .tab-content{\r\noverflow:hidden !important;\r\n}\r\n\r\n\r\n@media (min-width: 769px) {\r\n\r\n\t#tab_container_12541 .wpsm_nav-tabs > li{\r\n\t\tfloat:left !important ;\r\n\t\t\t\tmargin-right:-1px !important;\r\n\t\t\t\t\t}\r\n\t#tab_container_12541 .wpsm_nav-tabs{\r\n\t\tfloat:none !important;\r\n\t\tmargin:0px !important;\r\n\t}\r\n\r\n\t#tab_container_12541 .wpsm_nav-tabs > li {\r\n\t\t\t\t\r\n\t}\r\n\t#tab_container_12541 .wpsm_nav{\r\n\t\t\t}\r\n\r\n}\r\n\r\n\r\n\r\n@media (max-width: 768px) {\r\n\t#tab_container_12541 .wpsm_nav-tabs > li {\r\n\t\t\t\t\r\n\t}\r\n\t#tab_container_12541 .wpsm_nav{\r\n\t\t\t}\r\n}\r\n\r\n\r\n\t.wpsm_nav-tabs li:before{\r\n\t\tdisplay:none !important;\r\n\t}\r\n\r\n\t@media (max-width: 768px) {\r\n\t\t\t\t\r\n\t\t\t\t.wpsm_nav-tabs{\r\n\t\t\tmargin-left:0px !important;\r\n\t\t\tmargin-right:0px !important; \r\n\t\t\t\r\n\t\t}\r\n\t\t\t\t#tab_container_12541 .wpsm_nav-tabs > li{\r\n\t\t\tfloat:none !important;\r\n\t\t}\r\n\t\t\t\r\n\t}\t\t\t\t<\/style>\r\n\t\t\t\t<div id=\"tab_container_12541\" >\r\n\t \r\n\t\t\t\t\t<ul class=\"wpsm_nav wpsm_nav-tabs\" role=\"tablist\" id=\"myTab_12541\">\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t<li role=\"presentation\"  class=\"active\"  onclick=\"do_resize()\">\r\n\t\t\t\t\t\t\t\t<a href=\"#tabs_desc_12541_1\" aria-controls=\"tabs_desc_12541_1\" role=\"tab\" data-toggle=\"tab\">\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<i class=\"fa fa-code\"><\/i> \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t<span>Java<\/span>\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t<\/a>\r\n\t\t\t\t\t\t\t<\/li>\r\n\t\t\t\t\t\t\t\t\t\t\t <\/ul>\r\n\r\n\t\t\t\t\t  <!-- Tab panes -->\r\n\t\t\t\t\t  <div class=\"tab-content\" id=\"tab-content_12541\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t <div role=\"tabpanel\" class=\"tab-pane  in active \" id=\"tabs_desc_12541_1\">\r\n\t\t\t\t\t\t\t\t<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\">import java.util.*;\r\nimport java.lang.*;\r\nimport java.io.*;\r\n\r\n class WrapperExample2{    \r\npublic static void main(String args[]){    \r\nInteger a=new Integer(43);    \r\nint i=a.intValue(); \r\nint j=a;   \r\n    \r\nSystem.out.println(a+\" \"+i+\" \"+j);    \r\n}}<\/pre>\t\t\t\t\t\t <\/div>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t <\/div>\r\n\t\t\t\t\t \r\n\t\t\t\t <\/div>\r\n <script>\r\n\t\tjQuery(function () {\r\n\t\t\tjQuery('#myTab_12541 a:first').tab('show')\r\n\t\t});\r\n\t\t\r\n\t\t\t\tjQuery(function(){\r\n\t\t\tvar b=\"fadeIn\";\r\n\t\t\tvar c;\r\n\t\t\tvar a;\r\n\t\t\td(jQuery(\"#myTab_12541 a\"),jQuery(\"#tab-content_12541\"));function d(e,f,g){\r\n\t\t\t\te.click(function(i){\r\n\t\t\t\t\ti.preventDefault();\r\n\t\t\t\t\tjQuery(this).tab(\"show\");\r\n\t\t\t\t\tvar h=jQuery(this).data(\"easein\");\r\n\t\t\t\t\tif(c){c.removeClass(a);}\r\n\t\t\t\t\tif(h){f.find(\"div.active\").addClass(\"animated \"+h);a=h;}\r\n\t\t\t\t\telse{if(g){f.find(\"div.active\").addClass(\"animated \"+g);a=g;}else{f.find(\"div.active\").addClass(\"animated \"+b);a=b;}}c=f.find(\"div.active\");\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\r\n\t\tfunction do_resize(){\r\n\r\n\t\t\tvar width=jQuery( '.tab-content .tab-pane iframe' ).width();\r\n\t\t\tvar height=jQuery( '.tab-content .tab-pane iframe' ).height();\r\n\r\n\t\t\tvar toggleSize = true;\r\n\t\t\tjQuery('iframe').animate({\r\n\t\t\t    width: toggleSize ? width : 640,\r\n\t\t\t    height: toggleSize ? height : 360\r\n\t\t\t  }, 250);\r\n\r\n\t\t\t  toggleSize = !toggleSize;\r\n\t\t}\r\n\r\n\r\n\t<\/script>\r\n\t\t\t\t\r\n\t\t\t\n<p><strong>Output<\/strong><\/p>\n<pre><code>43 43 43<\/code><\/pre>\n<p><strong>Explanation of the above example<\/strong><br \/>\nIn the above example we have converted the Integer type class into int type primitive data type. By using wrapper class in java.<\/p>\n<h2>Example of Wrapper Class in Java<\/h2>\n<p>In this section, we will discuss the example of a wrapper class in java where we convert the primitive data type into corresponding class or objects.<\/p>\n<p><strong>Code:<\/strong><\/p>\n\t\t\t\t\t\t<style>\r\n\t\t\t\t\r\n\t\t\t\t\t#tab_container_12543 {\r\n\toverflow:hidden;\r\n\tdisplay:block;\r\n\twidth:100%;\r\n\tborder:0px solid #ddd;\r\n\tmargin-bottom:30px;\r\n\t}\r\n\r\n#tab_container_12543 .tab-content{\r\n\tpadding:20px;\r\n\tborder: 1px solid #e6e6e6 !important;\r\n\tmargin-top: 0px;\r\n\tbackground-color:#ffffff !important;\r\n\tcolor: #000000 !important;\r\n\tfont-size:16px !important;\r\n\tfont-family: Open Sans !important;\r\n\t\r\n\t\tborder: 1px solid #e6e6e6 !important;\r\n\t}\r\n#tab_container_12543 .wpsm_nav-tabs {\r\n    border-bottom: 0px solid #ddd;\r\n}\r\n#tab_container_12543 .wpsm_nav-tabs > li.active > a, #tab_container_12543 .wpsm_nav-tabs > li.active > a:hover, #tab_container_12543 .wpsm_nav-tabs > li.active > a:focus {\r\n\tcolor: #000000 !important;\r\n\tcursor: default;\r\n\tbackground-color: #ffffff !important;\r\n\tborder: 1px solid #e6e6e6 !important;\r\n}\r\n\r\n#tab_container_12543 .wpsm_nav-tabs > li > a {\r\n    margin-right: 0px !important; \r\n    line-height: 1.42857143 !important;\r\n    border: 1px solid #d5d5d5 !important;\r\n    border-radius: 0px 0px 0 0 !important; \r\n\tbackground-color: #e8e8e8 !important;\r\n\tcolor: #000000 !important;\r\n\tpadding: 15px 18px 15px 18px !important;\r\n\ttext-decoration: none !important;\r\n\tfont-size: 14px !important;\r\n\ttext-align:center !important;\r\n\tfont-family: Open Sans !important;\r\n}\r\n#tab_container_12543 .wpsm_nav-tabs > li > a:focus {\r\noutline: 0px !important;\r\n}\r\n\r\n#tab_container_12543 .wpsm_nav-tabs > li > a:before {\r\n\tdisplay:none !important;\r\n}\r\n#tab_container_12543 .wpsm_nav-tabs > li > a:after {\r\n\tdisplay:none !important ;\r\n}\r\n#tab_container_12543 .wpsm_nav-tabs > li{\r\npadding:0px !important ;\r\nmargin:0px;\r\n}\r\n\r\n#tab_container_12543 .wpsm_nav-tabs > li > a:hover , #tab_container_12543 .wpsm_nav-tabs > li > a:focus {\r\n    color: #000000 !important;\r\n    background-color: #e8e8e8 !important;\r\n\tborder: 1px solid #d5d5d5 !important;\r\n\t\r\n}\r\n#tab_container_12543 .wpsm_nav-tabs > li > a .fa{\r\n\r\nmargin-right:5px !important;\r\n\r\nmargin-left:5px !important;\r\n\r\n\r\n}\r\n\r\n\t\t#tab_container_12543 .wpsm_nav-tabs a{\r\n\t\t\tbackground-image: none;\r\n\t\t\tbackground-position: 0 0;\r\n\t\t\tbackground-repeat: repeat-x;\r\n\t\t}\r\n\t\t\t\r\n\r\n\r\n#tab_container_12543 .wpsm_nav-tabs > li {\r\n    float: left;\r\n    margin-bottom: -1px !important;\r\n\tmargin-right:0px !important; \r\n}\r\n\r\n\r\n#tab_container_12543 .tab-content{\r\noverflow:hidden !important;\r\n}\r\n\r\n\r\n@media (min-width: 769px) {\r\n\r\n\t#tab_container_12543 .wpsm_nav-tabs > li{\r\n\t\tfloat:left !important ;\r\n\t\t\t\tmargin-right:-1px !important;\r\n\t\t\t\t\t}\r\n\t#tab_container_12543 .wpsm_nav-tabs{\r\n\t\tfloat:none !important;\r\n\t\tmargin:0px !important;\r\n\t}\r\n\r\n\t#tab_container_12543 .wpsm_nav-tabs > li {\r\n\t\t\t\t\r\n\t}\r\n\t#tab_container_12543 .wpsm_nav{\r\n\t\t\t}\r\n\r\n}\r\n\r\n\r\n\r\n@media (max-width: 768px) {\r\n\t#tab_container_12543 .wpsm_nav-tabs > li {\r\n\t\t\t\t\r\n\t}\r\n\t#tab_container_12543 .wpsm_nav{\r\n\t\t\t}\r\n}\r\n\r\n\r\n\t.wpsm_nav-tabs li:before{\r\n\t\tdisplay:none !important;\r\n\t}\r\n\r\n\t@media (max-width: 768px) {\r\n\t\t\t\t\r\n\t\t\t\t.wpsm_nav-tabs{\r\n\t\t\tmargin-left:0px !important;\r\n\t\t\tmargin-right:0px !important; \r\n\t\t\t\r\n\t\t}\r\n\t\t\t\t#tab_container_12543 .wpsm_nav-tabs > li{\r\n\t\t\tfloat:none !important;\r\n\t\t}\r\n\t\t\t\r\n\t}\t\t\t\t<\/style>\r\n\t\t\t\t<div id=\"tab_container_12543\" >\r\n\t \r\n\t\t\t\t\t<ul class=\"wpsm_nav wpsm_nav-tabs\" role=\"tablist\" id=\"myTab_12543\">\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t<li role=\"presentation\"  class=\"active\"  onclick=\"do_resize()\">\r\n\t\t\t\t\t\t\t\t<a href=\"#tabs_desc_12543_1\" aria-controls=\"tabs_desc_12543_1\" role=\"tab\" data-toggle=\"tab\">\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<i class=\"fa fa-code\"><\/i> \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t<span>Java<\/span>\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t<\/a>\r\n\t\t\t\t\t\t\t<\/li>\r\n\t\t\t\t\t\t\t\t\t\t\t <\/ul>\r\n\r\n\t\t\t\t\t  <!-- Tab panes -->\r\n\t\t\t\t\t  <div class=\"tab-content\" id=\"tab-content_12543\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t <div role=\"tabpanel\" class=\"tab-pane  in active \" id=\"tabs_desc_12543_1\">\r\n\t\t\t\t\t\t\t\t<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\">\/\/Java Program to convert all primitives into its corresponding   \r\n\/\/wrapper objects and vice-versa  \r\n class WrapperExample3{  \r\npublic static void main(String args[]){  \r\nbyte b=2;  \r\nshort s=42;  \r\nint i=34;  \r\nlong l=40;  \r\nfloat f=75.0F;  \r\ndouble d=20.0D;  \r\nchar c='n';  \r\nboolean b2=false;  \r\n  \r\nByte byteobj=b;  \r\nShort shortobj=s;  \r\nInteger intobj=i;  \r\nLong longobj=l;  \r\nFloat floatobj=f;  \r\nDouble doubleobj=d;  \r\nCharacter charobj=c;  \r\nBoolean boolobj=b2;  \r\n  \r\n\/\/Printing objects  \r\nSystem.out.println(\"---Printing object values---\");  \r\nSystem.out.println(\"Byte object: \"+byteobj);  \r\nSystem.out.println(\"Integer object: \"+intobj);  \r\nSystem.out.println(\"Short object: \"+shortobj);  \r\nSystem.out.println(\"Long object: \"+longobj);  \r\nSystem.out.println(\"Double object: \"+doubleobj);  \r\nSystem.out.println(\"Float object: \"+floatobj);  \r\nSystem.out.println(\"Boolean object: \"+boolobj); \r\nSystem.out.println(\"Character object: \"+charobj);  \r\n \r\n  \r\n\/\/Unboxing: Converting Objects to Primitives  \r\nbyte bytevalue=byteobj;  \r\nshort shortvalue=shortobj;  \r\nint intvalue=intobj;  \r\nlong longvalue=longobj;  \r\nfloat floatvalue=floatobj;  \r\ndouble doublevalue=doubleobj;  \r\nchar charvalue=charobj;  \r\nboolean boolvalue=boolobj;  \r\n  \r\n\/\/Printing primitives  \r\nSystem.out.println(\"---Printing primitive values---\");  \r\nSystem.out.println(\"byte value: \"+bytevalue);  \r\nSystem.out.println(\"int value: \"+intvalue); \r\nSystem.out.println(\"short value: \"+shortvalue);  \r\nSystem.out.println(\"long value: \"+longvalue);  \r\nSystem.out.println(\"double value: \"+doublevalue);\r\nSystem.out.println(\"float value: \"+floatvalue); \r\nSystem.out.println(\"boolean value: \"+boolvalue);  \r\nSystem.out.println(\"char value: \"+charvalue);  \r\n}}<\/pre>\t\t\t\t\t\t <\/div>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t <\/div>\r\n\t\t\t\t\t \r\n\t\t\t\t <\/div>\r\n <script>\r\n\t\tjQuery(function () {\r\n\t\t\tjQuery('#myTab_12543 a:first').tab('show')\r\n\t\t});\r\n\t\t\r\n\t\t\t\tjQuery(function(){\r\n\t\t\tvar b=\"fadeIn\";\r\n\t\t\tvar c;\r\n\t\t\tvar a;\r\n\t\t\td(jQuery(\"#myTab_12543 a\"),jQuery(\"#tab-content_12543\"));function d(e,f,g){\r\n\t\t\t\te.click(function(i){\r\n\t\t\t\t\ti.preventDefault();\r\n\t\t\t\t\tjQuery(this).tab(\"show\");\r\n\t\t\t\t\tvar h=jQuery(this).data(\"easein\");\r\n\t\t\t\t\tif(c){c.removeClass(a);}\r\n\t\t\t\t\tif(h){f.find(\"div.active\").addClass(\"animated \"+h);a=h;}\r\n\t\t\t\t\telse{if(g){f.find(\"div.active\").addClass(\"animated \"+g);a=g;}else{f.find(\"div.active\").addClass(\"animated \"+b);a=b;}}c=f.find(\"div.active\");\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\r\n\t\tfunction do_resize(){\r\n\r\n\t\t\tvar width=jQuery( '.tab-content .tab-pane iframe' ).width();\r\n\t\t\tvar height=jQuery( '.tab-content .tab-pane iframe' ).height();\r\n\r\n\t\t\tvar toggleSize = true;\r\n\t\t\tjQuery('iframe').animate({\r\n\t\t\t    width: toggleSize ? width : 640,\r\n\t\t\t    height: toggleSize ? height : 360\r\n\t\t\t  }, 250);\r\n\r\n\t\t\t  toggleSize = !toggleSize;\r\n\t\t}\r\n\r\n\r\n\t<\/script>\r\n\t\t\t\t\r\n\t\t\t\n<p><strong>Output<\/strong><\/p>\n<pre><code>---Printing object values---\nByte object: 2\nInteger object: 34\nShort object: 42\nLong object: 40\nDouble object: 20.0\nFloat object: 75.0\nBoolean object: false\nCharacter object: n\n---Printing primitive values---\nbyte value: 2\nint value: 34\nshort value: 42\nlong value: 40\ndouble value: 20.0\nfloat value: 75.0\nboolean value: false\nchar value: n<\/code><\/pre>\n<p><strong>Explanation of the above example<\/strong><br \/>\nIn the above code we have taken all the eight primitive data type and have converted them into their classes or object like int to Integer and we can see the conversion in the output.<\/p>\n<h2>Custom Wrapper Class in Java<\/h2>\n<p>In Java we use a wrapper class in java to wrap the primitive data type but instead of using the wrapper class in java, we can create our own custom class which will wrap the primitive data type just like the wrapper class in java.<\/p>\n<p><strong>Example of Custom Wrapper class in Java<\/strong><br \/>\nNow, we will look at the example of creating a custom wrapper class.<\/p>\n\t\t\t\t\t\t<style>\r\n\t\t\t\t\r\n\t\t\t\t\t#tab_container_12544 {\r\n\toverflow:hidden;\r\n\tdisplay:block;\r\n\twidth:100%;\r\n\tborder:0px solid #ddd;\r\n\tmargin-bottom:30px;\r\n\t}\r\n\r\n#tab_container_12544 .tab-content{\r\n\tpadding:20px;\r\n\tborder: 1px solid #e6e6e6 !important;\r\n\tmargin-top: 0px;\r\n\tbackground-color:#ffffff !important;\r\n\tcolor: #000000 !important;\r\n\tfont-size:16px !important;\r\n\tfont-family: Open Sans !important;\r\n\t\r\n\t\tborder: 1px solid #e6e6e6 !important;\r\n\t}\r\n#tab_container_12544 .wpsm_nav-tabs {\r\n    border-bottom: 0px solid #ddd;\r\n}\r\n#tab_container_12544 .wpsm_nav-tabs > li.active > a, #tab_container_12544 .wpsm_nav-tabs > li.active > a:hover, #tab_container_12544 .wpsm_nav-tabs > li.active > a:focus {\r\n\tcolor: #000000 !important;\r\n\tcursor: default;\r\n\tbackground-color: #ffffff !important;\r\n\tborder: 1px solid #e6e6e6 !important;\r\n}\r\n\r\n#tab_container_12544 .wpsm_nav-tabs > li > a {\r\n    margin-right: 0px !important; \r\n    line-height: 1.42857143 !important;\r\n    border: 1px solid #d5d5d5 !important;\r\n    border-radius: 0px 0px 0 0 !important; \r\n\tbackground-color: #e8e8e8 !important;\r\n\tcolor: #000000 !important;\r\n\tpadding: 15px 18px 15px 18px !important;\r\n\ttext-decoration: none !important;\r\n\tfont-size: 14px !important;\r\n\ttext-align:center !important;\r\n\tfont-family: Open Sans !important;\r\n}\r\n#tab_container_12544 .wpsm_nav-tabs > li > a:focus {\r\noutline: 0px !important;\r\n}\r\n\r\n#tab_container_12544 .wpsm_nav-tabs > li > a:before {\r\n\tdisplay:none !important;\r\n}\r\n#tab_container_12544 .wpsm_nav-tabs > li > a:after {\r\n\tdisplay:none !important ;\r\n}\r\n#tab_container_12544 .wpsm_nav-tabs > li{\r\npadding:0px !important ;\r\nmargin:0px;\r\n}\r\n\r\n#tab_container_12544 .wpsm_nav-tabs > li > a:hover , #tab_container_12544 .wpsm_nav-tabs > li > a:focus {\r\n    color: #000000 !important;\r\n    background-color: #e8e8e8 !important;\r\n\tborder: 1px solid #d5d5d5 !important;\r\n\t\r\n}\r\n#tab_container_12544 .wpsm_nav-tabs > li > a .fa{\r\n\r\nmargin-right:5px !important;\r\n\r\nmargin-left:5px !important;\r\n\r\n\r\n}\r\n\r\n\t\t#tab_container_12544 .wpsm_nav-tabs a{\r\n\t\t\tbackground-image: none;\r\n\t\t\tbackground-position: 0 0;\r\n\t\t\tbackground-repeat: repeat-x;\r\n\t\t}\r\n\t\t\t\r\n\r\n\r\n#tab_container_12544 .wpsm_nav-tabs > li {\r\n    float: left;\r\n    margin-bottom: -1px !important;\r\n\tmargin-right:0px !important; \r\n}\r\n\r\n\r\n#tab_container_12544 .tab-content{\r\noverflow:hidden !important;\r\n}\r\n\r\n\r\n@media (min-width: 769px) {\r\n\r\n\t#tab_container_12544 .wpsm_nav-tabs > li{\r\n\t\tfloat:left !important ;\r\n\t\t\t\tmargin-right:-1px !important;\r\n\t\t\t\t\t}\r\n\t#tab_container_12544 .wpsm_nav-tabs{\r\n\t\tfloat:none !important;\r\n\t\tmargin:0px !important;\r\n\t}\r\n\r\n\t#tab_container_12544 .wpsm_nav-tabs > li {\r\n\t\t\t\t\r\n\t}\r\n\t#tab_container_12544 .wpsm_nav{\r\n\t\t\t}\r\n\r\n}\r\n\r\n\r\n\r\n@media (max-width: 768px) {\r\n\t#tab_container_12544 .wpsm_nav-tabs > li {\r\n\t\t\t\t\r\n\t}\r\n\t#tab_container_12544 .wpsm_nav{\r\n\t\t\t}\r\n}\r\n\r\n\r\n\t.wpsm_nav-tabs li:before{\r\n\t\tdisplay:none !important;\r\n\t}\r\n\r\n\t@media (max-width: 768px) {\r\n\t\t\t\t\r\n\t\t\t\t.wpsm_nav-tabs{\r\n\t\t\tmargin-left:0px !important;\r\n\t\t\tmargin-right:0px !important; \r\n\t\t\t\r\n\t\t}\r\n\t\t\t\t#tab_container_12544 .wpsm_nav-tabs > li{\r\n\t\t\tfloat:none !important;\r\n\t\t}\r\n\t\t\t\r\n\t}\t\t\t\t<\/style>\r\n\t\t\t\t<div id=\"tab_container_12544\" >\r\n\t \r\n\t\t\t\t\t<ul class=\"wpsm_nav wpsm_nav-tabs\" role=\"tablist\" id=\"myTab_12544\">\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t<li role=\"presentation\"  class=\"active\"  onclick=\"do_resize()\">\r\n\t\t\t\t\t\t\t\t<a href=\"#tabs_desc_12544_1\" aria-controls=\"tabs_desc_12544_1\" role=\"tab\" data-toggle=\"tab\">\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<i class=\"fa fa-code\"><\/i> \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t<span>Java<\/span>\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t<\/a>\r\n\t\t\t\t\t\t\t<\/li>\r\n\t\t\t\t\t\t\t\t\t\t\t <\/ul>\r\n\r\n\t\t\t\t\t  <!-- Tab panes -->\r\n\t\t\t\t\t  <div class=\"tab-content\" id=\"tab-content_12544\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t <div role=\"tabpanel\" class=\"tab-pane  in active \" id=\"tabs_desc_12544_1\">\r\n\t\t\t\t\t\t\t\t<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\">class Javatpoint{  \r\nprivate int i;  \r\nJavatpoint(){}  \r\nJavatpoint(int i){  \r\nthis.i=i;  \r\n}  \r\npublic int getValue(){  \r\nreturn i;  \r\n}  \r\npublic void setValue(int i){  \r\nthis.i=i;  \r\n}  \r\n@Override  \r\npublic String toString() {  \r\n  return Integer.toString(i);  \r\n}  \r\n}  \r\nclass TestJavatpoint{  \r\npublic static void main(String[] args){  \r\nJavatpoint j=new Javatpoint(40);  \r\nSystem.out.println(j);  \r\n}}<\/pre>\t\t\t\t\t\t <\/div>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t <\/div>\r\n\t\t\t\t\t \r\n\t\t\t\t <\/div>\r\n <script>\r\n\t\tjQuery(function () {\r\n\t\t\tjQuery('#myTab_12544 a:first').tab('show')\r\n\t\t});\r\n\t\t\r\n\t\t\t\tjQuery(function(){\r\n\t\t\tvar b=\"fadeIn\";\r\n\t\t\tvar c;\r\n\t\t\tvar a;\r\n\t\t\td(jQuery(\"#myTab_12544 a\"),jQuery(\"#tab-content_12544\"));function d(e,f,g){\r\n\t\t\t\te.click(function(i){\r\n\t\t\t\t\ti.preventDefault();\r\n\t\t\t\t\tjQuery(this).tab(\"show\");\r\n\t\t\t\t\tvar h=jQuery(this).data(\"easein\");\r\n\t\t\t\t\tif(c){c.removeClass(a);}\r\n\t\t\t\t\tif(h){f.find(\"div.active\").addClass(\"animated \"+h);a=h;}\r\n\t\t\t\t\telse{if(g){f.find(\"div.active\").addClass(\"animated \"+g);a=g;}else{f.find(\"div.active\").addClass(\"animated \"+b);a=b;}}c=f.find(\"div.active\");\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\r\n\t\tfunction do_resize(){\r\n\r\n\t\t\tvar width=jQuery( '.tab-content .tab-pane iframe' ).width();\r\n\t\t\tvar height=jQuery( '.tab-content .tab-pane iframe' ).height();\r\n\r\n\t\t\tvar toggleSize = true;\r\n\t\t\tjQuery('iframe').animate({\r\n\t\t\t    width: toggleSize ? width : 640,\r\n\t\t\t    height: toggleSize ? height : 360\r\n\t\t\t  }, 250);\r\n\r\n\t\t\t  toggleSize = !toggleSize;\r\n\t\t}\r\n\r\n\r\n\t<\/script>\r\n\t\t\t\t\r\n\t\t\t\n<p><strong>Output<\/strong><\/p>\n<pre><code>40<\/code><\/pre>\n<p><strong>Explanation of the above code<\/strong><br \/>\nIn the above example we are using the getter and setter functions to get and change the value of the private member of the class and after that, we are wrapping the value of the primitive data type just like wrapper class in java.<\/p>\n<h2>Advantages of Wrapper Class in Java<\/h2>\n<p>The following are the advantages of the wrapper class in java<\/p>\n<ul>\n<li><strong>Provide an Object representation of primitive data types:<\/strong> Wrapper classes provide an object representation of primitive data types, which allows developers to use primitives as objects in their code.<\/li>\n<li><strong>Facilitate type conversion:<\/strong> Wrapper classes can be used to convert primitive data types to and from String representation, making it easy to store primitives in collections or pass them as method arguments.<\/li>\n<li><strong>Help in implementing Autoboxing and Unboxing:<\/strong> Java provides a feature called Autoboxing and Unboxing, which automatically converts between primitive and wrapper class objects, simplifying the code and reducing the number of explicit type conversions required.<\/li>\n<\/ul>\n<h2>Disadvantages of Wrapper Class in Java<\/h2>\n<p>Below are the disadvantages of the wrapper class in java.<\/p>\n<ul>\n<li><strong>Performance Overhead:<\/strong> The process of converting primitive data types to and from Wrapper classes can result in performance overhead, especially in large-scale applications where this conversion takes place frequently.<\/li>\n<li><strong>Increased Memory Usage:<\/strong> Wrapper classes consume more memory than primitive data types, as they are objects and contain additional information like type information, methods, etc.<\/li>\n<li><strong>Immutable:<\/strong> Wrapper classes are immutable, meaning their values cannot be changed once they are created. This can be limiting in certain situations where it is necessary to modify the value of a primitive data type.<\/li>\n<\/ul>\n<p><strong>Conclusion<\/strong><br \/>\nWrapper classes in Java provide a bridge between primitive data types and objects, enabling developers to work with both efficiently. They offer a set of methods and utilities for converting between primitives and objects and are essential when working with collections, generics, and other parts of the Java API that require objects.<\/p>\n<p>In this article, we&#8217;ve explored the concept of wrapper classes, their usage, and the most commonly used wrapper classes in Java. We&#8217;ve also discussed autoboxing and unboxing, which simplify the process of converting between primitives and their corresponding wrapper objects.<\/p>\n<p>As you continue to develop Java applications, remember that wrapper classes are valuable tools for handling primitive data in object-oriented contexts. By mastering their usage, you can write more flexible and robust code that seamlessly integrates primitives and objects.<\/p>\n<h2>Frequently Asked Questions Related to Wrapper Class in Java<\/h2>\n<p>Here are some FAQs related to Wrapper Class in Java.<\/p>\n<p><strong>1. Can I convert between wrapper classes and primitive types in Java?<\/strong><br \/>\nYes, you can convert between wrapper classes and primitive types using methods provided by the wrapper classes. For example, you can use the intValue() method to extract the int value from an Integer object.<\/p>\n<p><strong>2. What are the common wrapper classes in Java?<\/strong><br \/>\nThe common wrapper classes in Java are Integer, Double, Character, Boolean, Float, Long, Short, and Byte. Each corresponds to a specific primitive data type.<\/p>\n<p><strong>3. What is autoboxing and unboxing in Java?<\/strong><br \/>\nAutoboxing is the automatic conversion of a primitive type to its corresponding wrapper class object, and unboxing is the reverse process. These features were introduced in Java to simplify the conversion between primitives and objects.<\/p>\n<p><strong>4. How can I create an instance of a wrapper class in Java?<\/strong><br \/>\nYou can create an instance of a wrapper class using its constructor, such as Integer myInt = new Integer(42);. However, autoboxing allows you to create instances more conveniently, like Integer myInt = 42;.<\/p>\n<p><strong>5. When should I use wrapper classes over primitive data types?<\/strong><br \/>\nYou should use wrapper classes when working with collections, generics, or APIs that require objects. Additionally, wrapper classes are useful for representing null values for primitive data types.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In Java, primitive data types like int, char, and float are simple and efficient for basic data storage, but they lack the flexibility to work with objects and perform certain operations. To bridge this gap between primitive types and objects, Java provides a set of wrapper classes. Wrapper classes are a group of classes that [&hellip;]<\/p>\n","protected":false},"author":52,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[143],"tags":[],"class_list":["post-12776","post","type-post","status-publish","format-standard","hentry","category-java"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Wrapper Class in Java Explanation with Examples<\/title>\n<meta name=\"description\" content=\"A wrapper class in Java is a class that wraps around a primitive data type and converts it into an object. Wrapper classes provide a way to treat primitive data types.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/prepbytes.com\/blog\/wrapper-class-in-java\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Wrapper Class in Java Explanation with Examples\" \/>\n<meta property=\"og:description\" content=\"A wrapper class in Java is a class that wraps around a primitive data type and converts it into an object. Wrapper classes provide a way to treat primitive data types.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/prepbytes.com\/blog\/wrapper-class-in-java\/\" \/>\n<meta property=\"og:site_name\" content=\"PrepBytes Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prepbytes0211\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-02-13T07:12:33+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-10-16T07:12:31+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1676272279952-Wrapper%20Class%20in%20Java.jpg\" \/>\n<meta name=\"author\" content=\"Prepbytes\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Prepbytes\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/prepbytes.com\/blog\/wrapper-class-in-java\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/wrapper-class-in-java\/\"},\"author\":{\"name\":\"Prepbytes\",\"@id\":\"http:\/\/43.205.93.38\/#\/schema\/person\/3f7dc4ae851791d5947a7f99df363d5e\"},\"headline\":\"Wrapper Class in Java\",\"datePublished\":\"2023-02-13T07:12:33+00:00\",\"dateModified\":\"2023-10-16T07:12:31+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/wrapper-class-in-java\/\"},\"wordCount\":2259,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\/\/43.205.93.38\/#organization\"},\"image\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/wrapper-class-in-java\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1676272279952-Wrapper%20Class%20in%20Java.jpg\",\"articleSection\":[\"Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/prepbytes.com\/blog\/wrapper-class-in-java\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/prepbytes.com\/blog\/wrapper-class-in-java\/\",\"url\":\"https:\/\/prepbytes.com\/blog\/wrapper-class-in-java\/\",\"name\":\"Wrapper Class in Java Explanation with Examples\",\"isPartOf\":{\"@id\":\"http:\/\/43.205.93.38\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/wrapper-class-in-java\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/wrapper-class-in-java\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1676272279952-Wrapper%20Class%20in%20Java.jpg\",\"datePublished\":\"2023-02-13T07:12:33+00:00\",\"dateModified\":\"2023-10-16T07:12:31+00:00\",\"description\":\"A wrapper class in Java is a class that wraps around a primitive data type and converts it into an object. Wrapper classes provide a way to treat primitive data types.\",\"breadcrumb\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/wrapper-class-in-java\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/prepbytes.com\/blog\/wrapper-class-in-java\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/prepbytes.com\/blog\/wrapper-class-in-java\/#primaryimage\",\"url\":\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1676272279952-Wrapper%20Class%20in%20Java.jpg\",\"contentUrl\":\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1676272279952-Wrapper%20Class%20in%20Java.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/prepbytes.com\/blog\/wrapper-class-in-java\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/43.205.93.38\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\/\/prepbytes.com\/blog\/category\/java\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Wrapper Class in Java\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/43.205.93.38\/#website\",\"url\":\"http:\/\/43.205.93.38\/\",\"name\":\"PrepBytes Blog\",\"description\":\"ONE-STOP RESOURCE FOR EVERYTHING RELATED TO CODING\",\"publisher\":{\"@id\":\"http:\/\/43.205.93.38\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/43.205.93.38\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"http:\/\/43.205.93.38\/#organization\",\"name\":\"Prepbytes\",\"url\":\"http:\/\/43.205.93.38\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/43.205.93.38\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/blog.prepbytes.com\/wp-content\/uploads\/2025\/07\/uzxxllgloialmn9mhwfe.webp\",\"contentUrl\":\"https:\/\/blog.prepbytes.com\/wp-content\/uploads\/2025\/07\/uzxxllgloialmn9mhwfe.webp\",\"width\":160,\"height\":160,\"caption\":\"Prepbytes\"},\"image\":{\"@id\":\"http:\/\/43.205.93.38\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/prepbytes0211\/\",\"https:\/\/www.instagram.com\/prepbytes\/\",\"https:\/\/www.linkedin.com\/company\/prepbytes\/\",\"https:\/\/www.youtube.com\/channel\/UC0xGnHDrjUM1pDEK2Ka5imA\"]},{\"@type\":\"Person\",\"@id\":\"http:\/\/43.205.93.38\/#\/schema\/person\/3f7dc4ae851791d5947a7f99df363d5e\",\"name\":\"Prepbytes\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/43.205.93.38\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/232042cd1a1ea0e982c96d2a2ec93fb70a8e864e00784491231e7bfe5a9e06b5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/232042cd1a1ea0e982c96d2a2ec93fb70a8e864e00784491231e7bfe5a9e06b5?s=96&d=mm&r=g\",\"caption\":\"Prepbytes\"},\"url\":\"https:\/\/prepbytes.com\/blog\/author\/gourav-jaincollegedekho-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Wrapper Class in Java Explanation with Examples","description":"A wrapper class in Java is a class that wraps around a primitive data type and converts it into an object. Wrapper classes provide a way to treat primitive data types.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/prepbytes.com\/blog\/wrapper-class-in-java\/","og_locale":"en_US","og_type":"article","og_title":"Wrapper Class in Java Explanation with Examples","og_description":"A wrapper class in Java is a class that wraps around a primitive data type and converts it into an object. Wrapper classes provide a way to treat primitive data types.","og_url":"https:\/\/prepbytes.com\/blog\/wrapper-class-in-java\/","og_site_name":"PrepBytes Blog","article_publisher":"https:\/\/www.facebook.com\/prepbytes0211\/","article_published_time":"2023-02-13T07:12:33+00:00","article_modified_time":"2023-10-16T07:12:31+00:00","og_image":[{"url":"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1676272279952-Wrapper%20Class%20in%20Java.jpg","type":"","width":"","height":""}],"author":"Prepbytes","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Prepbytes","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/prepbytes.com\/blog\/wrapper-class-in-java\/#article","isPartOf":{"@id":"https:\/\/prepbytes.com\/blog\/wrapper-class-in-java\/"},"author":{"name":"Prepbytes","@id":"http:\/\/43.205.93.38\/#\/schema\/person\/3f7dc4ae851791d5947a7f99df363d5e"},"headline":"Wrapper Class in Java","datePublished":"2023-02-13T07:12:33+00:00","dateModified":"2023-10-16T07:12:31+00:00","mainEntityOfPage":{"@id":"https:\/\/prepbytes.com\/blog\/wrapper-class-in-java\/"},"wordCount":2259,"commentCount":0,"publisher":{"@id":"http:\/\/43.205.93.38\/#organization"},"image":{"@id":"https:\/\/prepbytes.com\/blog\/wrapper-class-in-java\/#primaryimage"},"thumbnailUrl":"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1676272279952-Wrapper%20Class%20in%20Java.jpg","articleSection":["Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/prepbytes.com\/blog\/wrapper-class-in-java\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/prepbytes.com\/blog\/wrapper-class-in-java\/","url":"https:\/\/prepbytes.com\/blog\/wrapper-class-in-java\/","name":"Wrapper Class in Java Explanation with Examples","isPartOf":{"@id":"http:\/\/43.205.93.38\/#website"},"primaryImageOfPage":{"@id":"https:\/\/prepbytes.com\/blog\/wrapper-class-in-java\/#primaryimage"},"image":{"@id":"https:\/\/prepbytes.com\/blog\/wrapper-class-in-java\/#primaryimage"},"thumbnailUrl":"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1676272279952-Wrapper%20Class%20in%20Java.jpg","datePublished":"2023-02-13T07:12:33+00:00","dateModified":"2023-10-16T07:12:31+00:00","description":"A wrapper class in Java is a class that wraps around a primitive data type and converts it into an object. Wrapper classes provide a way to treat primitive data types.","breadcrumb":{"@id":"https:\/\/prepbytes.com\/blog\/wrapper-class-in-java\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/prepbytes.com\/blog\/wrapper-class-in-java\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/prepbytes.com\/blog\/wrapper-class-in-java\/#primaryimage","url":"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1676272279952-Wrapper%20Class%20in%20Java.jpg","contentUrl":"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1676272279952-Wrapper%20Class%20in%20Java.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/prepbytes.com\/blog\/wrapper-class-in-java\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/43.205.93.38\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/prepbytes.com\/blog\/category\/java\/"},{"@type":"ListItem","position":3,"name":"Wrapper Class in Java"}]},{"@type":"WebSite","@id":"http:\/\/43.205.93.38\/#website","url":"http:\/\/43.205.93.38\/","name":"PrepBytes Blog","description":"ONE-STOP RESOURCE FOR EVERYTHING RELATED TO CODING","publisher":{"@id":"http:\/\/43.205.93.38\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/43.205.93.38\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"http:\/\/43.205.93.38\/#organization","name":"Prepbytes","url":"http:\/\/43.205.93.38\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/43.205.93.38\/#\/schema\/logo\/image\/","url":"https:\/\/blog.prepbytes.com\/wp-content\/uploads\/2025\/07\/uzxxllgloialmn9mhwfe.webp","contentUrl":"https:\/\/blog.prepbytes.com\/wp-content\/uploads\/2025\/07\/uzxxllgloialmn9mhwfe.webp","width":160,"height":160,"caption":"Prepbytes"},"image":{"@id":"http:\/\/43.205.93.38\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/prepbytes0211\/","https:\/\/www.instagram.com\/prepbytes\/","https:\/\/www.linkedin.com\/company\/prepbytes\/","https:\/\/www.youtube.com\/channel\/UC0xGnHDrjUM1pDEK2Ka5imA"]},{"@type":"Person","@id":"http:\/\/43.205.93.38\/#\/schema\/person\/3f7dc4ae851791d5947a7f99df363d5e","name":"Prepbytes","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/43.205.93.38\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/232042cd1a1ea0e982c96d2a2ec93fb70a8e864e00784491231e7bfe5a9e06b5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/232042cd1a1ea0e982c96d2a2ec93fb70a8e864e00784491231e7bfe5a9e06b5?s=96&d=mm&r=g","caption":"Prepbytes"},"url":"https:\/\/prepbytes.com\/blog\/author\/gourav-jaincollegedekho-com\/"}]}},"_links":{"self":[{"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/posts\/12776","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/users\/52"}],"replies":[{"embeddable":true,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/comments?post=12776"}],"version-history":[{"count":4,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/posts\/12776\/revisions"}],"predecessor-version":[{"id":18196,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/posts\/12776\/revisions\/18196"}],"wp:attachment":[{"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/media?parent=12776"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/categories?post=12776"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/tags?post=12776"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}