namespace is not actually the group of classes. Actually coder can write a class in a namespace with some name and write another class with same name in another namespace. This way we can actually avoid the name clash. For example you write two classes with same name "Box", one under "Simple" namespace and other under "Complex" namespace. There will be no name clash error from the compiler, and you can access them using Simple::Box and Complex::Box.