Whenever, I start a new project in C#, I get the following:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
Why does using System;
not allow you to use the sub namespaces with just the one line? I'm looking for an underlying reason as to why this isn't allowed. In the example given in the answer by HuorSwords:
namespace First {
class A { }
}
namespace First.Second {
class A { }
}
I would still get an error if I do:
using First;
using First.Second;
function void Test()
{
A variable;
}
I would still have to differeniate between the two. So then why am I forced to declare both namespaces instead of just the one? Aside from potential ambiguity, is there any other reason why we have to declare each namespace like this?