The functions of the two colons (:) in C # Colon: C #
Source: Internet
Author: User
Global: system. Console. writeline (number); where is the colon used? point is the space class, which indicates the meaning of the next layer? Here: The GAC identifier "Global" is used in a special way, and "." is not a type. Global is a new keyword in C #2.0. Theoretically, if CodeIf you write well, you do not need to use it. Suppose you have written a class named system. Then when you write System in the Code, the compiler does not know whether you want to refer to the system class or the system namespace, the system namespace is already the root namespace and cannot be specified by a full name restriction. In the previous C # version, this is an unsolved problem. Now, you can use global: System to represent the system root namespace, and use your own mynamespace. System to represent your class.
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.