

{"id":6869,"date":"2018-01-31T12:09:23","date_gmt":"2018-01-31T06:39:23","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=6869"},"modified":"2024-04-18T22:51:22","modified_gmt":"2024-04-18T17:21:22","slug":"java-number","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/java-number\/","title":{"rendered":"Java Numbers &#8211; Number Methods with Syntax and Examples"},"content":{"rendered":"<div class='__iawmlf-post-loop-links' style='display:none;' data-iawmlf-post-links='[{&quot;id&quot;:2045,&quot;href&quot;:&quot;https:\\\/\\\/algs4.cs.princeton.edu\\\/13stacks\\\/Autoboxing.java.html&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20250404115131\\\/https:\\\/\\\/algs4.cs.princeton.edu\\\/13stacks\\\/Autoboxing.java.html&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2025-12-10 23:50:51&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-14 07:04:29&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-24 04:36:44&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-27 19:11:36&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-17 20:28:59&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-06 11:07:44&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-11 07:02:13&quot;,&quot;http_code&quot;:206}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-05-11 07:02:13&quot;,&quot;http_code&quot;:206},&quot;process&quot;:&quot;done&quot;}]'><\/div>\n<p>In the previous article, we learned about the concept of Java Wrapper classes and why we need them during development. Java String class, Java Number class are all examples of these wrapper classes which convert a primitive datatype to an object of the class. Here in this article, we are going to talk about the Number class and its methods in Java programming.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/01\/Number-Class-in-Java-df.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-78556\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/01\/Number-Class-in-Java-df.jpg\" alt=\"Java Number class\" width=\"1200\" height=\"628\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/01\/Number-Class-in-Java-df.jpg 1200w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/01\/Number-Class-in-Java-df-300x157.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/01\/Number-Class-in-Java-df-1024x536.jpg 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/01\/Number-Class-in-Java-df-150x79.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/01\/Number-Class-in-Java-df-768x402.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/01\/Number-Class-in-Java-df-520x272.jpg 520w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><\/p>\n<h2>Number Class in Java<\/h2>\n<p>We have to note that the number class is not a real class but an abstract class. It has the following wrapper classes that define the functions inside it.<\/p>\n<p>a. Integer<br \/>\nb. Byte<br \/>\nc. Double<br \/>\nd. Short<br \/>\ne. Float<br \/>\nf. Long<\/p>\n<p><strong>The number class is a part of the java.lang package.<\/strong><br \/>\nYou can see and remember that these are the same as the primitive data types we learned about in the previous articles. But all of these are individual classes that are signified by the capital letters starting each class name(This is a class naming convention).<\/p>\n<p>The compiler automatically converts the primitive data type to an object and vice versa as and when required by a particular function or scope of the program. This is called Autoboxing and Unboxing. We will learn about them soon.<\/p>\n<h2>Why should you use a wrapper class instead of a primitive datatype?<\/h2>\n<p>Now, the question arises as to why you should use Wrapper Class objects when you can simply use primitive datatypes?<br \/>\nThe answer lies in the use of these objects.<\/p>\n<ul>\n<li>There are many methods that take an Object as an argument. We can use Wrapper class objects there. Eg-MAX_VALUE, MIN_VALUE.<\/li>\n<li>There is also a need for manipulating and performing particular functions on a datatype. That is when objects can be used.<\/li>\n<li>Interconversion methods such as binary to hexadecimal can be used by passing the particular number as an object.<\/li>\n<li>There are particular constants that are provided by the number class which is useful while programming.<\/li>\n<\/ul>\n<h2>Methods of Java Number Class<\/h2>\n<p>There are a lot of classes that implement the abstract class but there are some methods that are common to all the classes. Some of them are explained below.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/01\/Methods-of-Number-Class-in-Java.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-78557\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/01\/Methods-of-Number-Class-in-Java.jpg\" alt=\"Methods of Number Class in Java\" width=\"765\" height=\"366\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/01\/Methods-of-Number-Class-in-Java.jpg 765w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/01\/Methods-of-Number-Class-in-Java-300x144.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/01\/Methods-of-Number-Class-in-Java-150x72.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/01\/Methods-of-Number-Class-in-Java-520x249.jpg 520w\" sizes=\"auto, (max-width: 765px) 100vw, 765px\" \/><\/a><\/p>\n<h3>1. Value Method in Java<\/h3>\n<p>This method converts the value of the number object into the datatype mentioned. It has the syntax as:<\/p>\n<p><strong>&lt;variable&gt;.&lt;datatype&gt;Value(); <\/strong><\/p>\n<p>After conversion it stores the value in a datatype which is primitive.<\/p>\n<p><strong>Java program to illustrate the use of Value method:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">package com.dataflair.numberclass;\r\npublic class ValueMethod {\r\n  public static void main(String[] args) {\r\n    Integer num1 = new Integer(\"5\");\r\n    float f = num1.floatValue();\r\n    double d = num1.doubleValue();\r\n\r\n    System.out.println(\"The integer value converted to float is \" + f);\r\n    System.out.println(\"The integer value converted to double is \" + d);\r\n\r\n  }\r\n\r\n}<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">The integer value converted to float is 5.0<br \/>\nThe integer value converted to double is 5.0<\/div>\n<h3>2. Java compareTo Method<\/h3>\n<p>The compareTo function compares a given object to a different object of the same type. If both the values are the same then the function returns 0. If the given number is less than the argument then it returns -1. Else it returns 1.<\/p>\n<p>Its syntax is:<\/p>\n<p><strong>int compareTo(NumberClass ReferenceName);<\/strong><\/p>\n<p><strong>Java program to illustrate the use of compareTo:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">package com.dataflair.numberclass;\r\npublic class CompareToMethod {\r\n  public static void main(String[] args) {\r\n    Integer num1 = new Integer(\"5\");\r\n    System.out.println(\"comparing num1 with 10 is \" + num1.compareTo(10));\r\n    System.out.println(\"comparing num1 with 1 is \" + num1.compareTo(1));\r\n\r\n  }\r\n\r\n}<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">comparing num1 with 10 is -1<br \/>\ncomparing num1 with 1 is 1<\/div>\n<h3>3. equals Method in Java<\/h3>\n<p>The equals method checks if the number and the argument passed through the method is not null and equal to the number. If both the numbers are equal, it returns true. If not, it returns false. They also have to be of the same type.<\/p>\n<p>The syntax is:<\/p>\n<p><strong>boolean &lt;variable&gt;.equals(Reference)<\/strong><\/p>\n<p><strong>Java program to illustrate the usage of equals method:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">package com.dataflair.numberclass;\r\npublic class EqualsMethod {\r\n  public static void main(String[] args) {\r\n    Integer num1 = new Integer(\"5\");\r\n    Short s = new Short(\"5\");\r\n    Integer num2 = new Integer(\"5\");\r\n    System.out.println(\"Is the short value equal to num1? \" + num1.equals(s));\r\n    System.out.println(\"is the integer value equal to num1? \" + num1.equals(num2));\r\n\r\n  }\r\n\r\n}<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">Is the short value equal to num1? false<br \/>\nis the integer value equal to num1? true<\/div>\n<h3>4. parseInt Method in Java<\/h3>\n<p>This method converts the value of the String passed through it into a data type which is a primitive datatype which, in this case, is int. If we want to convert to other datatypes such as float or long we have to use parseFloat or parseLong.<\/p>\n<p>The radix is the base of the string from which it is to be converted to decimal. Care should be taken that the string does not contain any digits which lie outside the scope of the radix mentioned. For example, if the radix is 2 which signifies a binary base then the string cannot have numbers other than 0 or 1. If it does the compiler will throw an exception.<\/p>\n<p>There are two methods of using the parseInt method:<\/p>\n<p><strong>a. int Integer.parseInt(String,radix);<\/strong><br \/>\n<strong>b. int Integer.parseInt(String);<\/strong><\/p>\n<p>When no radix is mentioned it has a default value of 10 which means all the strings passed without a radix would be converted to a decimal number.<\/p>\n<p><strong>Java program to illustrate the use of parseInt:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">package com.dataflair.numberclass;\r\npublic class ParseIntMethod {\r\n  public static void main(String[] args) {\r\n    int num1 = Integer.parseInt(\"AB\", 16);\r\n    int num2 = Integer.parseInt(\"1001\", 2);\r\n    int num3 = Integer.parseInt(\"543\"); \/\/if no radix is mentioned it is converted to decimal. \r\n\r\n    System.out.println(\"num1 \" + num1); \/\/Hexadecimal converted to decimal\r\n    System.out.println(\"num2 \" + num2); \/\/Binary converted to decimal\r\n    System.out.println(\"num3 \" + num3); \/\/Direct conversion of string to decimal\r\n\r\n  }\r\n\r\n}<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">num1 171<br \/>\nnum2 9<br \/>\nnum3 543<\/div>\n<h3>5. toString Method in Java<\/h3>\n<p>Java toString method is used for converting a numeric datatype to a string. This helps in returning the value of an object. Calling this method means, overriding the .toString() method. It is useful while printing the value of the object. Although while printing an object, the compiler automatically invokes the .toString() method.<\/p>\n<p>It has four variations:<\/p>\n<p><strong>a. &lt;variable&gt;.toString()<\/strong><br \/>\n<strong>b. Integer.toBinaryString(int i);<\/strong><br \/>\n<strong>c. Integer.toHexString(int i);<\/strong><br \/>\n<strong>d. Integer.toOctalString(int i);<\/strong><\/p>\n<p>The variation where an integer value i is passed returns a decimal String object of value i.<\/p>\n<p><strong>Java program to illustrate the use of toString method:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">package com.dataflair.numberclass;\r\npublic class ToStringMethod {\r\n  public static void main(String[] args) {\r\n    Integer int1 = new Integer(\"167\");\r\n    System.out.println(\"Converting to decimal string\" + int1.toString());\r\n    System.out.println(\"Converting to octal string \" + Integer.toOctalString(int1));\r\n    System.out.println(\"Converting to Hexadecimal string \" + Integer.toHexString(int1));\r\n\r\n  }\r\n\r\n}<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">Converting to decimal string167<br \/>\nConverting to octal string 247<br \/>\nConverting to Hexadecimal string a7<\/div>\n<h3>6. valueof Method in Java<\/h3>\n<p>This method returns the number object which is relevant. Simply put, this method converts the argument passed through it to an Integer object. However if there is a radix mentioned in the argument, the respective data is converted into the base of the radix first and then converted to an Integer object. This is a static method.<\/p>\n<p>There are three alternative ways to use this method:<br \/>\n<strong>a. valueOf(int i)-<\/strong> This returns an Integer object which represents the integer value.<br \/>\n<strong>b. valueOf(String i)-<\/strong> This returns an Integer representation of the string passed<br \/>\n<strong>c. valueOf(String i,radix)-<\/strong>This returns an Integer representation of the string passed of base radix.<\/p>\n<p><strong>Java program to illustrate the use of valueOf:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">package com.dataflair.numberclass;\r\npublic class ValueOfMethod {\r\n  public static void main(String[] args) {\r\n    Integer int1 = new Integer(\"167\");\r\n    System.out.println(\"Using Integer.valueOf(int1) is \" + Integer.valueOf(int1));\r\n\r\n    System.out.println(\"Using Integer.valueOf(\\\"542\\\") is \" + Integer.valueOf(\"542\"));\r\n\r\n    System.out.println(\"Using Integer.valueOf(\\\"AB2\\\") is \" + Integer.valueOf(\"AB2\", 16));\r\n\r\n  }\r\n\r\n}<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">Using Integer.valueOf(int1)is 167<br \/>\nUsing Integer.valueOf(&#8220;542&#8221;) is 542<br \/>\nUsing Integer.valueOf(&#8220;AB2&#8221;)is 2738<\/div>\n<h2>Autoboxing and Unboxing in Java<\/h2>\n<p><a href=\"https:\/\/algs4.cs.princeton.edu\/13stacks\/Autoboxing.java.html\">Java Autoboxing<\/a> is the process of converting a primitive datatype to its specific wrapper class object. This is useful when:<\/p>\n<ul>\n<li>Primitive datatype is passed as an argument to a method that expects an object.<\/li>\n<li>Variable is assigned to the corresponding wrapper class.<\/li>\n<\/ul>\n<p><strong>Java Unboxing<\/strong> is the reverse of autoboxing. It is the process of converting the Wrapper class object into its corresponding primitive datatype. This is useful when:<\/p>\n<ul>\n<li>Wrapper class object is used where a primitive datatype is expected.<\/li>\n<li>It is assigned to a primitive variable.<\/li>\n<\/ul>\n<p><strong>Java program to illustrate the concept of Autoboxing and Unboxing:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">package com.dataflair.numberclass;\r\npublic class AutoboxingUnboxing {\r\n  public static void main(String[] args) {\r\n    System.out.println(\"Understanding Autoboxing\");\r\n    \/\/This is a primitive datatype\r\n    Integer i = 10;\r\n    \/\/Autoboxing of the primitive value 10 to an object\r\n\r\n    System.out.println(\"The integer is \" + i);\r\n\r\n    System.out.println(\"Understanding Unboxing\");\r\n\r\n    Integer num = new Integer(98);\r\n    int unboxnum = num;\r\n    \/\/Unboxing of the num object to a primitive datatype int\r\n    System.out.println(\"The value of the integer is \" + unboxnum);\r\n  }\r\n}<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">Understanding Autoboxing<br \/>\nThe integer is 10<br \/>\nUnderstanding Unboxing<br \/>\nThe value of the integer is 98<\/div>\n<h3>Java autoboxing- and unboxing<\/h3>\n<p>Autoboxing seamlessly links primitive data types with their corresponding wrapper classes, while unboxing reverses this process, converting wrapper objects back to primitives for greater code readability and efficiency. This is illustrated in the snippet Integer num = 10; \/\/ Autoboxing where the integer value 10 is automatically converted to an Integer object, and then subsequently unboxed back to the primitive int type in int num2 = num; \/\/ Unboxing.<\/p>\n<h2>Summary<\/h2>\n<p>In this Java Tutorial, we learnt about Java Number Class. We learnt about a lot of methods of the Integer class which have specific functions. These functions save us a lot of time while doing minute manipulations such as converting the bases and so on.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the previous article, we learned about the concept of Java Wrapper classes and why we need them during development. Java String class, Java Number class are all examples of these wrapper classes which&#46;&#46;&#46;<\/p>\n","protected":false},"author":7,"featured_media":78556,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32],"tags":[2154,6841,6846,6849,7613,7614,9151,9159,16458],"class_list":["post-6869","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java","tag-boolean-equals","tag-int-compareto","tag-int-parseint","tag-integer-valueof","tag-java-number-examples","tag-java-number-methods","tag-number-class-java","tag-numbers-in-java","tag-what-is-java-number"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Java Numbers - Number Methods with Syntax and Examples - DataFlair<\/title>\n<meta name=\"description\" content=\"Java number class is an abstract class which is located in java.lang package. There are 7 number methods available in Java learn with examples\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/java-number\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Java Numbers - Number Methods with Syntax and Examples - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Java number class is an abstract class which is located in java.lang package. There are 7 number methods available in Java learn with examples\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/java-number\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2018-01-31T06:39:23+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-18T17:21:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/01\/Number-Class-in-Java-df.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Java Numbers - Number Methods with Syntax and Examples - DataFlair","description":"Java number class is an abstract class which is located in java.lang package. There are 7 number methods available in Java learn with examples","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:\/\/data-flair.training\/blogs\/java-number\/","og_locale":"en_US","og_type":"article","og_title":"Java Numbers - Number Methods with Syntax and Examples - DataFlair","og_description":"Java number class is an abstract class which is located in java.lang package. There are 7 number methods available in Java learn with examples","og_url":"https:\/\/data-flair.training\/blogs\/java-number\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2018-01-31T06:39:23+00:00","article_modified_time":"2024-04-18T17:21:22+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/01\/Number-Class-in-Java-df.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/java-number\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/java-number\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/beb0cab24b7aa54423a3b50e669a9dcd"},"headline":"Java Numbers &#8211; Number Methods with Syntax and Examples","datePublished":"2018-01-31T06:39:23+00:00","dateModified":"2024-04-18T17:21:22+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/java-number\/"},"wordCount":1247,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/java-number\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/01\/Number-Class-in-Java-df.jpg","keywords":["boolean equals","int compareTo","int parseInt","Integer valueOf","Java Number examples","Java Number Methods","number class java","numbers in java","What is Java Number"],"articleSection":["Java Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/java-number\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/java-number\/","url":"https:\/\/data-flair.training\/blogs\/java-number\/","name":"Java Numbers - Number Methods with Syntax and Examples - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/java-number\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/java-number\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/01\/Number-Class-in-Java-df.jpg","datePublished":"2018-01-31T06:39:23+00:00","dateModified":"2024-04-18T17:21:22+00:00","description":"Java number class is an abstract class which is located in java.lang package. There are 7 number methods available in Java learn with examples","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/java-number\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/java-number\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/java-number\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/01\/Number-Class-in-Java-df.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/01\/Number-Class-in-Java-df.jpg","width":1200,"height":628,"caption":"Java Number class"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/java-number\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Java Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/java\/"},{"@type":"ListItem","position":3,"name":"Java Numbers &#8211; Number Methods with Syntax and Examples"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/beb0cab24b7aa54423a3b50e669a9dcd","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/c322416204232f4dd97ef3901b0a499a5d34d7ba7fe333f4bfe53a907873d293?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/c322416204232f4dd97ef3901b0a499a5d34d7ba7fe333f4bfe53a907873d293?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c322416204232f4dd97ef3901b0a499a5d34d7ba7fe333f4bfe53a907873d293?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team specializes in creating clear, actionable content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Backed by industry expertise, we make learning easy and career-oriented for beginners and pros alike.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam3\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/6869","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=6869"}],"version-history":[{"count":15,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/6869\/revisions"}],"predecessor-version":[{"id":136222,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/6869\/revisions\/136222"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/78556"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=6869"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=6869"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=6869"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}