Answer the question
In order to leave comments, you need to log in
WITH#. Why is it necessary to write using System.ChildNamespace when using System is already indicated?
In theory, the System space should include nested ones, for example, System.Collections and others.
Why list them separately?
Is it necessary to write System.Collections and, for example, System.Collections.Generic separately?
Answer the question
In order to leave comments, you need to log in
It shouldn't, these are logically different visibility zones. Plus, classes with the same names can be located in different namespaces, here your compiler will go crazy, and for each mention of a class you will need to make a clarification in the form of a full name.
Hello.
Namespaces are just a logical division of code. Physically, code in System is not required to include code in System.Collections or any other code prefixed with System.(prefix). System -- simply indicates that you are including some system kernel code.
Here you can see the naming
Often, you can not write using at all, and classes are always specified in full:
System.Int32 i = 10;
System.Console.WriteLine("Строка");
System.Collections.Generic.List<int> list = new System.Collections.Generic.List<int>();
Int32 i = 10;
Console.WriteLine("Строка");
List<int> list = new List<int>();
using IntList = System.Collections.Generic.List<int>;
IntList lst = new IntList();
List<double> lst2 = new List<double>();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question