{"id":1789,"date":"2022-08-27T14:31:25","date_gmt":"2022-08-27T09:01:25","guid":{"rendered":"http:\/\/coderzpy.com\/?p=1789"},"modified":"2022-08-27T14:31:26","modified_gmt":"2022-08-27T09:01:26","slug":"double-class-in-java","status":"publish","type":"post","link":"https:\/\/coderzpy.com\/java\/double-class-in-java\/","title":{"rendered":"Double class in Java"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The Double class is a wrapper class for the primitive type double. It contains several methods for dealing with double values effectively, such as converting them to string representations and vice versa. A Double object can only hold one double value.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>Constructor<\/strong> of Double wrapper class:<\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">There are mainly two constructors to initialize a Double-object<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>public Double(Double d) \npublic Double(String s) throws NumberFormatException<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">Methods of Double wrapper class:<\/h5>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><th>Methods<\/th><th>Description<\/th><\/tr><tr><td>boolean\u00a0<strong>doubleValue<\/strong>()<\/td><td>Returns a primitive double value from a Double wrapper object.<\/td><\/tr><tr><td>int\u00a0<strong>compareTo<\/strong>(Double b)<\/td><td>-If the invoked Double object has the same Double value as b, it returns a zero.<br>-Returns a positive value if the value of the invoked Double object is greater than b. <br>-If the invoked object has a smaller value than b, it returns a negative value.<\/td><\/tr><tr><td>boolean\u00a0<strong>equals<\/strong>(Object ob)<\/td><td>Returns true if the Double object invoked has the same value as referred by ob, otherwise false.<\/td><\/tr><tr><td>static\u00a0Double\u00a0<strong>parseDouble<\/strong>(String s)<\/td><td>Converts a String value to a primitive double value.<\/td><\/tr><tr><td>static\u00a0Double\u00a0<strong>valueOf<\/strong>(double b)<\/td><td>Returns a Double object after converting it from a primitive Double value\u00a0b.<\/td><\/tr><tr><td>static\u00a0Double\u00a0<strong>valueOf<\/strong>(String s)<\/td><td>Returns a Double object after converting it from a String s.<\/td><\/tr><tr><td>short\u00a0<strong>shortValue<\/strong>()<\/td><td>Returns a primitive short value after converting a Double object to it.<\/td><\/tr><tr><td>byte\u00a0<strong>byteValue<\/strong>()<\/td><td>Returns a primitive byte value after converting a Double object to it.<\/td><\/tr><tr><td>int\u00a0<strong>intValue<\/strong>()<\/td><td>Returns a primitive int value after converting a Double object to it.<\/td><\/tr><tr><td>long\u00a0<strong>longValue<\/strong>()<\/td><td>Returns a primitive long value after converting a Double object to it.<\/td><\/tr><tr><td>float\u00a0<strong>floatValue<\/strong>()<\/td><td>Returns a primitive float value after converting a Double object to it.<\/td><\/tr><tr><td>boolean <strong>isNaN<\/strong>()<\/td><td>If the double object under consideration is not a number, it returns true; otherwise, it returns false.<\/td><\/tr><tr><td><strong>hashCode<\/strong>()<\/td><td>It returns the hash code for the given Double object.<\/td><\/tr><tr><td>boolean <strong>isInfinite<\/strong>()<\/td><td>If the double object under consideration is very large, it returns true; otherwise, it returns false.<\/td><\/tr><tr><td>double\u00a0<strong>doubleValue<\/strong>()<\/td><td>Returns a primitive double value after converting a Double object to it.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h5 class=\"wp-block-heading\">Example: Illustrating the use of various methods<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>public class Coderz \n{  \n    public static void main(String&#091;] args) \n  {  \n   Double d1 = 4d;  \n   Double d2 = 67d;  \n   Double d3 = Double.NaN;   \n   Double d4 = Double.POSITIVE_INFINITY;   \n   \/\/ Returns the hashCode.  \n   System.out.println(\"The hashCode for the number '\"+d1+\"' is given as :\"+ d1.hashCode());  \n     \n   \/\/ Returns the integer type value.   \n   System.out.println(\"The interger type value for the double '\"+d2+\"' is given as :\"+d2.intValue());  \n      \n    \/\/ Returns a boolean value   \n   System.out.println(\"Is the number '\"+d3+\"' is NaN? :\"+d3.isNaN());  \n      \n   \/\/ Check whether the number is finitwe or not.  \n    System.out.println(\"Is the number '\"+d2+\"' is finite? \"+d4.isInfinite());    \n      \n    }  \n}   \n<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">Output:<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>The hashCode for the number '4.0' is given as :1074790400\r\nThe interger type value for the double '67.0' is given as :67\r\nIs the number 'NaN' is NaN? :true\r\nIs the number '67.0' is finite? true\r\n<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">Example: Using compareTo() method\u00a0<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>class Coderz\n{\npublic static void main(String &#091;]args)\n{\nDouble d1 = new Double(\"5.5\"); \/\/Constructor accepting String value\nDouble d2 = new Double(5.5);\t  \/\/Constructor accepting primitive boolean value\n\nSystem.out.println(\"Value in d1 = \"+d1);\nSystem.out.println(\"Value in d2 = \"+d2);\n\nSystem.out.println(\"Invoking \"+d1 +\"to compare with\"+ d2 +\": \"+ d1.compareTo(d2));\n\nDouble d3 = new Double(\"20.5\");\nDouble d4 = new Double(10.5);\n\nSystem.out.println(\"Value in d3 = \"+d3);\nSystem.out.println(\"Value in d4 = \"+d4);\n\nSystem.out.println(\"Invoking \"+d3+\" to compare with \"+d4 +\": \"+ d3.compareTo(d4));\n\nSystem.out.println(\"Invoking \"+d4 +\"to compare with \"+d3+\" : \"+ d4.compareTo(d3));\n\n}\n}                                                   <\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">Output:<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>Value in d1 = 5.5\nValue in d2 = 5.5\nInvoking 5.5 to compare with 5.5: 0\r\nValue in d3 = 20.5\r\nValue in d4 = 10.5\r\nInvoking 20.5 to compare with 10.5: 1\nInvoking 10.5 to compare with 20.5 : -1<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">Exception when converting a String to a Double object\/primitive double:<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>\nclass Coderz\n{\npublic static void main(String &#091;]args)\n{\nDouble b1 = new Double(\"100.5ft\"); \/\/Passing a String value that is not a valid primitive float value.\n}\n}<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">Output:<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>Exception in thread \"main\" java.lang.NumberFormatException: For input string: \"100.5ft\"\r\n\tat java.base\/jdk.internal.math.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2054)\r\n\tat java.base\/jdk.internal.math.FloatingDecimal.parseDouble(FloatingDecimal.java:110)at java.base\/java.lang.Double.parseDouble(Double.java:543)\r\n\tat java.base\/java.lang.Double.&lt;init&gt;(Double.java:625)\r\n\tat Coderz.main(Coderz.java:6)\r\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">NumberFormatException\u00a0is raised when we pass String value to the constructor of Double class or its method parseDouble(), which is not a legal double value or it is out-of-range.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Note: also read about<\/em>\u00a0the\u00a0<a href=\"https:\/\/coderzpy.com\/float-class-in-java\/\">Float class in Java<\/a><\/p>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>Follow Me<\/strong><\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">If you like my post, please follow me to read my latest post on programming and technology.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/www.instagram.com\/coderz.py\/\">https:\/\/www.instagram.com\/coderz.py\/<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/www.facebook.com\/coderz.py\">https:\/\/www.facebook.com\/coderz.py<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Double class is a wrapper class for the primitive type double. It contains several methods for dealing with double &#8230;<\/p>\n","protected":false},"author":3,"featured_media":1549,"menu_order":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[61],"tags":[274,128,96,94,170],"class_list":["post-1789","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java","tag-double-class","tag-exception","tag-method","tag-oops","tag-wrapper-class"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.1.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"The Double class is a wrapper class for the primitive type double. It contains several methods for dealing with double values effectively, such as converting them to string representations and vice versa. A Double object can only hold one double value. Constructor of Double wrapper class: There are mainly two constructors to initialize a Double-object\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Rabecca Fatima\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/coderzpy.com\/java\/double-class-in-java\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.1.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"coderz.py - Keep Coding Keep Cheering!\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Double class in Java - coderz.py\" \/>\n\t\t<meta property=\"og:description\" content=\"The Double class is a wrapper class for the primitive type double. It contains several methods for dealing with double values effectively, such as converting them to string representations and vice versa. A Double object can only hold one double value. Constructor of Double wrapper class: There are mainly two constructors to initialize a Double-object\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/coderzpy.com\/java\/double-class-in-java\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2022-08-27T09:01:25+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2022-08-27T09:01:26+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Double class in Java - coderz.py\" \/>\n\t\t<meta name=\"twitter:description\" content=\"The Double class is a wrapper class for the primitive type double. It contains several methods for dealing with double values effectively, such as converting them to string representations and vice versa. A Double object can only hold one double value. Constructor of Double wrapper class: There are mainly two constructors to initialize a Double-object\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https:\\\/\\\/coderzpy.com\\\/java\\\/double-class-in-java\\\/#blogposting\",\"name\":\"Double class in Java - coderz.py\",\"headline\":\"Double class in Java\",\"author\":{\"@id\":\"https:\\\/\\\/coderzpy.com\\\/author\\\/rabecca\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/coderzpy.com\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/coderzpy.com\\\/wp-content\\\/uploads\\\/2022\\\/05\\\/85390-java-language-text-programming-logo-programmer.png\",\"width\":651,\"height\":400,\"caption\":\"java thread class\"},\"datePublished\":\"2022-08-27T14:31:25+05:30\",\"dateModified\":\"2022-08-27T14:31:26+05:30\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/coderzpy.com\\\/java\\\/double-class-in-java\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/coderzpy.com\\\/java\\\/double-class-in-java\\\/#webpage\"},\"articleSection\":\"Java, Double class, exception, method, OOPs, Wrapper class\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/coderzpy.com\\\/java\\\/double-class-in-java\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/coderzpy.com#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/coderzpy.com\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/coderzpy.com\\\/course\\\/java\\\/#listItem\",\"name\":\"Java\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/coderzpy.com\\\/course\\\/java\\\/#listItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/coderzpy.com\\\/course\\\/java\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/coderzpy.com\\\/java\\\/double-class-in-java\\\/#listItem\",\"name\":\"Double class in Java\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/coderzpy.com#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/coderzpy.com\\\/java\\\/double-class-in-java\\\/#listItem\",\"position\":3,\"name\":\"Double class in Java\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/coderzpy.com\\\/course\\\/java\\\/#listItem\",\"name\":\"Java\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/coderzpy.com\\\/#organization\",\"name\":\"coderz.py\",\"description\":\"Keep Coding Keep Cheering!\",\"url\":\"https:\\\/\\\/coderzpy.com\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/coderzpy.com\\\/author\\\/rabecca\\\/#author\",\"url\":\"https:\\\/\\\/coderzpy.com\\\/author\\\/rabecca\\\/\",\"name\":\"Rabecca Fatima\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/coderzpy.com\\\/java\\\/double-class-in-java\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/209225ca96598bab25f758a45345c5082dc77605dc36a7caeb0a66b601be2860?s=96&d=identicon&r=g\",\"width\":96,\"height\":96,\"caption\":\"Rabecca Fatima\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/coderzpy.com\\\/java\\\/double-class-in-java\\\/#webpage\",\"url\":\"https:\\\/\\\/coderzpy.com\\\/java\\\/double-class-in-java\\\/\",\"name\":\"Double class in Java - coderz.py\",\"description\":\"The Double class is a wrapper class for the primitive type double. It contains several methods for dealing with double values effectively, such as converting them to string representations and vice versa. A Double object can only hold one double value. Constructor of Double wrapper class: There are mainly two constructors to initialize a Double-object\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/coderzpy.com\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/coderzpy.com\\\/java\\\/double-class-in-java\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/coderzpy.com\\\/author\\\/rabecca\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/coderzpy.com\\\/author\\\/rabecca\\\/#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/coderzpy.com\\\/wp-content\\\/uploads\\\/2022\\\/05\\\/85390-java-language-text-programming-logo-programmer.png\",\"@id\":\"https:\\\/\\\/coderzpy.com\\\/java\\\/double-class-in-java\\\/#mainImage\",\"width\":651,\"height\":400,\"caption\":\"java thread class\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/coderzpy.com\\\/java\\\/double-class-in-java\\\/#mainImage\"},\"datePublished\":\"2022-08-27T14:31:25+05:30\",\"dateModified\":\"2022-08-27T14:31:26+05:30\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/coderzpy.com\\\/#website\",\"url\":\"https:\\\/\\\/coderzpy.com\\\/\",\"name\":\"coderz.py\",\"description\":\"Keep Coding Keep Cheering!\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/coderzpy.com\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Double class in Java - coderz.py","description":"The Double class is a wrapper class for the primitive type double. It contains several methods for dealing with double values effectively, such as converting them to string representations and vice versa. A Double object can only hold one double value. Constructor of Double wrapper class: There are mainly two constructors to initialize a Double-object","canonical_url":"https:\/\/coderzpy.com\/java\/double-class-in-java\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/coderzpy.com\/java\/double-class-in-java\/#blogposting","name":"Double class in Java - coderz.py","headline":"Double class in Java","author":{"@id":"https:\/\/coderzpy.com\/author\/rabecca\/#author"},"publisher":{"@id":"https:\/\/coderzpy.com\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/coderzpy.com\/wp-content\/uploads\/2022\/05\/85390-java-language-text-programming-logo-programmer.png","width":651,"height":400,"caption":"java thread class"},"datePublished":"2022-08-27T14:31:25+05:30","dateModified":"2022-08-27T14:31:26+05:30","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/coderzpy.com\/java\/double-class-in-java\/#webpage"},"isPartOf":{"@id":"https:\/\/coderzpy.com\/java\/double-class-in-java\/#webpage"},"articleSection":"Java, Double class, exception, method, OOPs, Wrapper class"},{"@type":"BreadcrumbList","@id":"https:\/\/coderzpy.com\/java\/double-class-in-java\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/coderzpy.com#listItem","position":1,"name":"Home","item":"https:\/\/coderzpy.com","nextItem":{"@type":"ListItem","@id":"https:\/\/coderzpy.com\/course\/java\/#listItem","name":"Java"}},{"@type":"ListItem","@id":"https:\/\/coderzpy.com\/course\/java\/#listItem","position":2,"name":"Java","item":"https:\/\/coderzpy.com\/course\/java\/","nextItem":{"@type":"ListItem","@id":"https:\/\/coderzpy.com\/java\/double-class-in-java\/#listItem","name":"Double class in Java"},"previousItem":{"@type":"ListItem","@id":"https:\/\/coderzpy.com#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/coderzpy.com\/java\/double-class-in-java\/#listItem","position":3,"name":"Double class in Java","previousItem":{"@type":"ListItem","@id":"https:\/\/coderzpy.com\/course\/java\/#listItem","name":"Java"}}]},{"@type":"Organization","@id":"https:\/\/coderzpy.com\/#organization","name":"coderz.py","description":"Keep Coding Keep Cheering!","url":"https:\/\/coderzpy.com\/"},{"@type":"Person","@id":"https:\/\/coderzpy.com\/author\/rabecca\/#author","url":"https:\/\/coderzpy.com\/author\/rabecca\/","name":"Rabecca Fatima","image":{"@type":"ImageObject","@id":"https:\/\/coderzpy.com\/java\/double-class-in-java\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/209225ca96598bab25f758a45345c5082dc77605dc36a7caeb0a66b601be2860?s=96&d=identicon&r=g","width":96,"height":96,"caption":"Rabecca Fatima"}},{"@type":"WebPage","@id":"https:\/\/coderzpy.com\/java\/double-class-in-java\/#webpage","url":"https:\/\/coderzpy.com\/java\/double-class-in-java\/","name":"Double class in Java - coderz.py","description":"The Double class is a wrapper class for the primitive type double. It contains several methods for dealing with double values effectively, such as converting them to string representations and vice versa. A Double object can only hold one double value. Constructor of Double wrapper class: There are mainly two constructors to initialize a Double-object","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/coderzpy.com\/#website"},"breadcrumb":{"@id":"https:\/\/coderzpy.com\/java\/double-class-in-java\/#breadcrumblist"},"author":{"@id":"https:\/\/coderzpy.com\/author\/rabecca\/#author"},"creator":{"@id":"https:\/\/coderzpy.com\/author\/rabecca\/#author"},"image":{"@type":"ImageObject","url":"https:\/\/coderzpy.com\/wp-content\/uploads\/2022\/05\/85390-java-language-text-programming-logo-programmer.png","@id":"https:\/\/coderzpy.com\/java\/double-class-in-java\/#mainImage","width":651,"height":400,"caption":"java thread class"},"primaryImageOfPage":{"@id":"https:\/\/coderzpy.com\/java\/double-class-in-java\/#mainImage"},"datePublished":"2022-08-27T14:31:25+05:30","dateModified":"2022-08-27T14:31:26+05:30"},{"@type":"WebSite","@id":"https:\/\/coderzpy.com\/#website","url":"https:\/\/coderzpy.com\/","name":"coderz.py","description":"Keep Coding Keep Cheering!","inLanguage":"en-US","publisher":{"@id":"https:\/\/coderzpy.com\/#organization"}}]},"og:locale":"en_US","og:site_name":"coderz.py - Keep Coding Keep Cheering!","og:type":"article","og:title":"Double class in Java - coderz.py","og:description":"The Double class is a wrapper class for the primitive type double. It contains several methods for dealing with double values effectively, such as converting them to string representations and vice versa. A Double object can only hold one double value. Constructor of Double wrapper class: There are mainly two constructors to initialize a Double-object","og:url":"https:\/\/coderzpy.com\/java\/double-class-in-java\/","article:published_time":"2022-08-27T09:01:25+00:00","article:modified_time":"2022-08-27T09:01:26+00:00","twitter:card":"summary_large_image","twitter:title":"Double class in Java - coderz.py","twitter:description":"The Double class is a wrapper class for the primitive type double. It contains several methods for dealing with double values effectively, such as converting them to string representations and vice versa. A Double object can only hold one double value. Constructor of Double wrapper class: There are mainly two constructors to initialize a Double-object"},"aioseo_meta_data":{"post_id":"1789","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"created":"2024-12-30 12:24:45","updated":"2026-09-02 21:36:44","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/coderzpy.com\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/coderzpy.com\/course\/java\/\" title=\"Java\">Java<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tDouble class in Java\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/coderzpy.com"},{"label":"Java","link":"https:\/\/coderzpy.com\/course\/java\/"},{"label":"Double class in Java","link":"https:\/\/coderzpy.com\/java\/double-class-in-java\/"}],"_links":{"self":[{"href":"https:\/\/coderzpy.com\/wp-json\/wp\/v2\/posts\/1789","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/coderzpy.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/coderzpy.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/coderzpy.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/coderzpy.com\/wp-json\/wp\/v2\/comments?post=1789"}],"version-history":[{"count":1,"href":"https:\/\/coderzpy.com\/wp-json\/wp\/v2\/posts\/1789\/revisions"}],"predecessor-version":[{"id":1790,"href":"https:\/\/coderzpy.com\/wp-json\/wp\/v2\/posts\/1789\/revisions\/1790"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/coderzpy.com\/wp-json\/wp\/v2\/media\/1549"}],"wp:attachment":[{"href":"https:\/\/coderzpy.com\/wp-json\/wp\/v2\/media?parent=1789"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/coderzpy.com\/wp-json\/wp\/v2\/categories?post=1789"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/coderzpy.com\/wp-json\/wp\/v2\/tags?post=1789"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}