For example the Console class we use is in the System namespace. The Window class is in the Gtk namespace. Classes in namespaces must be accesed by putting the namespace in front of the class name.
System.Console.WriteLine("Hello, World!"); // instead of Console.WriteLine("Hello, World!");This can result in pretty much typing work, so you can use such namespaces. This will, that the compiler will look in all used namespaces for the class. If it is found twice it will give an error. So instead of writing System.Console... we can write:
using System; ... Console.WriteLine("Hello, World!");It is common to use at least System. Nobody would write System.Console.WriteLine().
You can also put your own code in namespaces. All you have to do is:
namespace mynamespace { // ... }You can also put a namespace inside another namespace:
namespace HigherNamspace { namespace mynamespace { // ... } }This is equal to:
namespace HigherNamspace.mynamespace { // ... }