Namespace
Namespaces are used to organize code into logical groups and to prevent name collisions that can occur especially when your code base includes multiple libraries. We can have namespace inside namespace(Sub-namespace). In order to declare namespace we need to use namespace keyword and we need to give name for that.
In order to access members of a class which is present inside difference namespace. We need to first call the outer most namespace then we need to call sub namespaces then we need to call class then only we can access members of that particular class. We'll see this with code example below
CODE
EG 1 . Creating a namespace with a class and a Sub-namespace.
//Either we can refer namespace here or we can each time call individual namespaces and access its member(Explained clearly in CODE EXPLANATION).
using NewlyCreatedNamespace;
using NewlyCreatedNamespace.subNamespace1.space;
namespace NewlyCreatedNamespace {
    public static class basicMath {
        public static double Deg2Rad(double degree) {
            return degree * Math.PI / 180;
        }
        public static double Rad2Deg(double radian) {
            return radian * 180 / Math.PI;
        }
    }
    namespace subNamespace1 {
        namespace space {
            public class rectangle {
                public double length, width, height;
                public double Area() {
                    return length * width;
                }
                public double Perimeter() {
                    return 2 * (length + width);
                }
                public double Volume() {
                    return Area() * height;
                }
            }
        }
    }
}
namespace ProjectName {
    internal class Program {
        static void Main() {
            //We need to give entire directory of namespaces then only we can access class and its members.
            NewlyCreatedNamespace.basicMath.Deg2Rad(30);
            NewlyCreatedNamespace.subNamespace1.space.rectangle wall = new NewlyCreatedNamespace.subNamespace1.space.rectangle();
        }
    }
}
(Click Here, For more exercises)