The value range of the Java Language Foundation long and float who is big or small

Source: Internet
Author: User

Conclusion

The value range of float is larger than long

Verify

1  Public classtest1_datatypeconversion {2 3      Public Static voidMain (string[] args) {4 5         floatf = 1.3f;6         LongL = 34;7 //L = f;8 //System.out.println (l);9         //Type Mismatch:cannot convert from float to longTenf =l; One System.out.println (f); A  -      -     } the  -}

Byte short char does not convert to int automatically when mixed operation is performed

The value range size is as follows

Char < int < Long < float <double

Double the maximum range of values

The value range of float is greater than long

Although long has a length of 8 bytes, the length of float is 4 bytes but their underlying storage structure is different, the value represented by the size is also different

The value range of the Java Language Foundation long and float who is big or small

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.