C # built-in type

Source: Internet
Author: User

Built-in type: The type that is written in the. NET Framework System namespace.

Let's see what the built-in types are in C #

The built-in types above, except string and object, are all referred to as simple types. You can also think of the left as a C # type of keyword, the left is the type of aliases, keywords and aliases can be interchangeable.

The effect is the same as int i=1 and System.Int32 i=1.

Maybe you're skeptical about the above, but. NET gives us a way to get the actual type of C # type GetType () method, such as int i;,i.gettype (); The result will be system.int32. As long as the types listed in the table above are used, the results obtained using the GetType () method are the same as the right. Here's a look at the custom type.

Code  class test{   staticvoid Main (string[] args) {person      p=new person;      Console.WriteLine (P.gettype ());      Console.readkey ();  }} class person{}

The result of the output is person. The GetType () method returns the namespace. class name if there is no namespace, then the class name is returned.

Thank you, we're here today. We study together

C # built-in type

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.