What is the difference between bool and Boolean in C? What is the difference between string and string?

Source: Internet
Author: User

From: http://hi.baidu.com/%CA%B8%C8%D0/blog/item/7d3392f883d4ecd5b48f31dc.html

1. bool is the basic value type, and Boolean is the object.

2. bool is the alias of Boolean. bool is in C #, and Boolean is in. NET Framework.

Out of curiosity about Boolean, I used reflector to decompile mscorlib. dll and get the BooleanSource code, See the following content:

Public Struct Boolean: icomparable, iconvertible, icomparable < Bool > , Iequatable < Bool >
{
Private BoolM_value;
//Omitting definitions of other members .....
}

The relationship between bool and Boolean in msdn is: "The bool keyword is the alias of system. boolean". There is no difference in actual use. Their members are the same.
Finally, bool is like your milk name. You know your mom and dad and all the members inside you, and Boolean is like your learning name. Everyone knows. However, whether you are called by Student name or subject name, the ultimate goal is the same, or you.

This is also true for the relationship between string and string.

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.