<P> In some languages , all variables are global , or global by default , while in most modern languages variables have limited scope , generally lexical scope , though global variables are often available by declaring a variable at the top level of the program . In other languages , however , global variables do not exist ; these are generally modular programming languages that enforce a module structure , or class - based object - oriented programming languages that enforce a class structure . </P>
<P> In some languages , all variables are global , or global by default , while in most modern languages variables have limited scope , generally lexical scope , though global variables are often available by declaring a variable at the top level of the program . In other languages , however , global variables do not exist ; these are generally modular programming languages that enforce a module structure , or class - based object - oriented programming languages that enforce a class structure . </P>
where is a variable that has class or global scope declared
where is a variable that has class or global scope declared
at the top level of the program
at the top level of the program