C # some basic knowledge

Source: Internet
Author: User

Variables and constants in C #
C # basic data types: Value Type and reference type
Value Type: simple type, structure type, and enumeration type.
Simple Type: integer, floating point, decimal, and Boolean
Sbyte is signed and equivalent to the byte type of java, range:-128 ~ 127
In C #, byte is unsigned and ranges from 0 ~ 255

Object-oriented in C #
Destructor: The function name is the same as the constructor name ,~ Function Name (). parameters are not accepted and are automatically called by the garbage collector (GC. Collect)

Virtual Keyword: in C #, to override the method of the parent class, the method of the parent class must be identified as virtual (virtual), and the override method must be modified with override.
New Keyword: A new method defined in the subclass is the same as the signature of the parent method. It is not a method to override the parent class.
Base Keyword: Use the base keyword to call the method of the parent class

Access modifier:
Public,
Internal in a project,
Protected Parent-Child class,
Private is only a member of the class.

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.