like opening and then automatically closing files or freeing up memory. See Resource Acquisition Is Initialization (RAII). Since C++11, C++ allows variables to be declared with the auto type specifier, but this means that the variable's type is inferred, and does not refer to the scope of the variable. Java (Called local variables.) Similar to C and C++, but there is no auto or register keyword. However, the Java compiler will not allow the usage of a not-explicitly-initialized local variable and will give a compilation error (unlike C and C++ where the compiler will usually only give a warning). The Java standard demands that every local variable must be explicitly initialized before being used. This differs from instance variables, which are implicitly initialized with default values (which are for numbers and for objects). Perl (Called lexical, my or private variables.) In Perl, local variables are declared using the my operator. Uninitialized scalars will have the value undef; uninitialized arrays or hashes will be (). Perl also has a local operator that does not create automatic variables, instead giving global (package) variables a temporary value, which is dynamically scoped to the enclosing block. When the scope of the variable is left, the old value is restored. See also C syntax#Storage class specifiers Variable-length array (C99 new feature) Call stack Object lifetime Notes References Memory management Variable (computer science) es:Asignación automática de memoria de:Automatische Variable