Double is the original data type, double is the encapsulated data type
Double has no method, double has its own property and method
Double creates the reference only, double creates the object
The collection class cannot hold double, only double
Double is stored in the stack, double is stored in the heap
The stack is accessed faster than the heap, and the data in the stack can be shared
Such as:
Double A = 0;
Double b = 0;
object is not created, only two references are established, pointing to the variable "0" (stack data sharing)
and
Double A = new double (0);
Double b = new double (0);
Creates two objects, even if the object represents the same value ( heap data is not shared )
Therefore, it is appropriate to use double in terms of efficiency, and the properties and methods provided by double will make operation of various operations more convenient and flexible.
This article is from the "Nothing qq:934033381" blog, please be sure to keep this source http://tianxingzhe.blog.51cto.com/3390077/1701325
The difference between a long and long in Java