The difference between boolean.valueof (true) and True

Source: Internet
Author: User

The 1.Boolean is a Boolean encapsulated class that extends many methods.

2.true storage space is one byte. You need to produce a Boolean instance, open a new memory space, and then take the Boolean value.

3.boolean.valueof (True) returns a Boolean value specified by a Boolean instance. Returns Boolean.true if the specified Boolean value is TRUE, or returns Boolean.false if the specified Boolean value is FALSE.

4.valueOf () is a static method of the base data type Boolean corresponding to the encapsulated class Boolean, and returns a Boolean object (Boolean.true or Boolean.false).

5. The difference is that boolean.valueof (true) does not require the development of memory space, and it is recommended that boolean.valueof (true) improve space and time performance from the point of view of both the programming and the memory.

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.