Variables declared and defined in the Program , has scope associated with in. Namespace is a place variables have reference in it. Variables can be declared outside the function,variables as function parameters, variables declared with in the function,variables declared with in the nested functions, variables in the class attributes.
Variables has following scopeNote:
A class is never used as a global scopeADS