Why import a child namespace when importing a parent name?

Why does anyone have

Import System

as well as

Import System.Web.UI.WebControls

If the system is the root of all namespaces, then what only harm is the presence of an import system in the code.

+3
source share
2 answers

If you import Systemimported all the lower-level namespaces, then there would be little reason to have an import at all.

But the reason we have a namespace system is to avoid name conflicts when different packages contain classes with the same name.

, ( ) System.Secure System.Insecure. http , , , , .

, . , .

+2

Import System . .

+1

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


All Articles