Integer doubleValue() Method in Java Last Updated : 07 Jul, 2018 Comments Improve Suggest changes Like Article Like Report The doubleValue() method of Integer class of java.lang package is used to convert the value of the given Integer to a Double type after a widening primitive conversion and returns it. Syntax: public double doubleValue() Parameters: The method does not take any parameter. Return Value: This method returns a numeric value represented by this object after conversion to double type. Below programs illustrate java.lang.Integer.doubleValue() method. Program 1: java // Code to illustrate doubleValue() method import java.lang.Integer; class Gfg { // Driver code public static void main(String args[]) { Integer a = new Integer(14); // Convert Integer number to double value double b = a.doubleValue(); System.out.println(b); } } Output: 14.0 Program 2: java // Code to illustrate doubleValue() method import java.lang.Integer; class Gfg { // Driver code public static void main(String args[]) { Integer a = new Integer(120); // Convert Integer number to double value double b = a.doubleValue(); System.out.println(b); } } Output: 120.0 Comment More infoAdvertise with us Next Article Integer doubleValue() Method in Java N Niraj_Pandey Follow Improve Article Tags : Java Practice Tags : Java Similar Reads Integer floatValue() Method in Java floatValue() method of Integer class present inside java.lang package is used to convert the value of the given Integer to a float type after a widening primitive conversion which in general is mostly applicable when we want to truncate or rounding-off the integer value. The package view is as follo 2 min read Java Integer byteValue() Method The byteValue() method of Integer class of java.lang package converts the given Integer into a byte after a narrowing primitive conversion and returns it (value of integer object as a byte). Also, remember this method does override byteValue() method of the Number class. The package view is as follo 2 min read Integer decode() Method in Java It is often seen that any integer within (" ") is also considered as string, then it is needed to decode that into the integer. The main function of java.lang.Integer.decode() method is to decode a String into an Integer. The method also accepts decimal, hexadecimal, and octal numbers. Syntax : publ 2 min read Integer hashCode() Method in Java The java.lang.Integer.hashCode() method of Integer class in Java is used to return the hash code for a particular Integer . Syntax: public int hashCode() Parameters : The method does not take any parameters. Return Value: The method returns a hash code integer value for this object, which is equal t 2 min read Java Integer compare() method The compare() method of Integer class of java.lang package compares two integer values (x, y) given as a parameter and returns the value zero if (x==y), if (x < y) then it returns a value less than zero and if (x > y) then it returns a value greater than zero. Syntax : public static int compar 2 min read Double intValue() method in Java with examples The intValue() method of Double class is a built in method to return the value specified by the calling object as int after type casting. Syntax: DoubleObject.intValue() Return Value: It return the value of DoubleObject as int. Below programs illustrate intValue() method in Java: Program 1: Java // 2 min read Java Integer compareTo() method The compareTo() method of Integer class of java.lang package compares two Integer objects numerically and returns the value 0 if this Integer is equal to the argument Integer; a value less than 0 if this Integer is numerically less than the argument Integer; and a value greater than 0 if this Intege 2 min read Integer sum() Method in Java The java.lang.Integer.sum() is a built-in method in java that returns the sum of its arguments. The method adds two integers together as per the + operator. Syntax : public static int sum(int a, int b) Parameter: The method accepts two parameters that are to be added with each other: a : the first i 2 min read BigDecimal intValue() Method in Java The java.math.BigDecimal.intValue() is an in-built function which converts this BigDecimal to an integer value. This function discards any fractional part of this BigDecimal. If the result of the conversion is too big to be represented as an integer value, the function returns only the lower-order 3 2 min read DoubleAdder intValue() method in Java with Examples The java.DoubleAdder.intValue() is an inbuilt method in java that returns the sum() as an int after a narrowing primitive conversion. When the object of the class is created its initial value is zero. Syntax: public int intValue() Parameters: This method does not accepts any parameter. Return Value: 1 min read Like