What is the difference between Double
and double
?
What is double in Java “double” is a data type that stores floating point numbers. It is similar to a float data type. Unlike, a float which stores 32 bit IEEE 745 floating point numbers, double stores 64-but IEEE 754 floating point numbers.
In brief, long is an integral type whereas double is a floating point type. 1.Java Data Types, Available here. 2.“Data Types in Java.” GeeksforGeeks, 7 Sept. 2018, Available here.
Doubleis an object and doubleis a primitive data type. See this answer for more details. The Double class wraps a value of the primitive type double in an object. An object of type Double contains a single field whose type is
Double is reference type and double is value type. The Double class wraps a value of the primitive type double in an object. An object of type Double contains a single field whose type is double." link As @Fess mentioned and because Double is reference type it can be null.
Double
is an object and double
is a primitive data type. See this answer for more details.
The Double class wraps a value of the primitive type double in an object. An object of type Double contains a single field whose type is double.
Source: http://docs.oracle.com/javase/7/docs/api/java/lang/Double.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With