Items are imported even without namespace import

Despite the fact that we do not import the "System" namespace, it can be accessed by the various elements included in the "System" namespace. as well as aliases for different types (string, single, bool, decimal ...), the class of objects, as well as the functions of the class of objects. These items are visible through Intellisence. And when we import the System Name-space (using System), we get access to all types in it (Array, Enum and much more), as well as to the actual types (System.String, System.Float, etc.).

Can someone tell me why this is?

+3
source share
2 answers

# {bool, byte, char, decimal, double, float, int, long, object, sbyte, short, string, uint, ulong, ushort} BCL System, #

, , "string" , # System.String . ( !), using MSIL, , "" "System.String", StringBuilder (, , "System.Text;", "System.Text.StringBuilder".

+1

:

"CLR ASP.NET. ASP.NET, Import CLR. System, System.Collections, System.IO, System.Web, System.Web.UI, System.Web.UI.HTMLControls System.Web.UI.WebControls - , CLR. , System. , , , ."

http://www.redacron.com/tutorials/ASPNET/namespaces.php

.

+1

Source: https://habr.com/ru/post/1733544/


All Articles