Difference between long and Long in java

Source: Internet
Author: User

Difference between long and Long in java
Double is the original data type, Double is the encapsulation data type double has no method, Double has its own properties and Methods double only create reference, Double create object set class cannot store double, only Doubledouble can be stored in the stack. Double can be stored in the stack. The access speed of the stack is higher than that of the stack. Data in the stack can be shared, for example, double a = 0; double B = 0; no object is created. Only two references are created, pointing to the variable "0" (stack data sharing) and Double a = new Double (0); Double B = new Double (0 ); two objects will be created, even if the object represents the same value (heap data is not shared), so double is suitable for efficiency, the properties and methods provided by Double make operations more convenient and flexible.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.