Minor Namespace Feature

Namespaces in C# and packages in Java are a convenient method of keeping related classes together. If you want to use code in another package in java you need to import the classes. This means that two distinct namespaces are entirely unrelated.

I used to think that the C# namespaces worked in the same way.  However it seems that namespaces form a hiearchy.

Namespace A.B.C automatically has access to Namespaces A and A.B

This is a minor detail but is not that clearly stated in the tutorials that you normally get.  It is in the language guide but not as clearly stated as it could be. 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s