Integer Programming Book
In programming, variables are placeholders in memory, as its name suggests, the content may change over the execution of a program. A variable is a reserved area on the computer's main memory can be of length:. Fixed . - When the size of it will not change over the execution of the program. All variables, whatever they are are fixed length, with some exceptions - such as collections of other variables (arrays) or chains. Because the variables contain or point to values ??of particular types, operations on the same domain and their values ??are determined by the type of data involved. Some types of data used:. Worth . - Copy the value (information) of the variable in the call stack, local level, which corresponds to the new subroutine call. Therefore, this subroutine gets the value but can not modify the original variable. This means that if the variable is altered within this routine, to gain access to such amendments at the end, you must return the new value of it. If you perform this operation, the value of the variable will be exactly the same as it was before going through the function. By reference . - No value is passed directly to the variable, if not a reference or pointer to it, which contains the address of the memory area that hosts the content, "so that it operates directly on the area memory that contains it, which means that modifications to suffer will be accessible afterwards. The variables are represented by identifiers that refer to a program memory which stores a datum. A variable is associated with a data type, which depending on the size and the same determined number of bytes that will be needed to store the variable. In the case of collections and unlike the other data type, whether primitive or complex objects, the memory allocated to store such variables are not known in advance, which leads to establish policies for memory allocation:. Memory Book . - implies fixed predetermined amount of memory to be allocated to the collection. Policy is extremely rigid, as it reaches the end of the memory area could not store new items. Memory Book . - variable area is dedicated memory and can be of a predetermined size or not, and if exceeded the area of ??memory is reallocated another area, contiguous or not, to prevent the restriction mentioned above. Local: When it is only accessible from a single child process and can not be read or modified from another procedure brother or father from the procedure itself. You can declare variables in blocks of conditions, loops, etc. so that they can only be accessed in the block itself. While it is true that a basic form, you can define the scope of variables in the way described above, there are degrees of comprehensiveness of the same and can be accessed from one point or other, or may be accessible between applications different, reaching for the superglobal. Example of the scope of a variable in the Java integer programming book language. Keep in mind that in Java the case of global variables to all methods that are in a class, is rather peculiar, since they really are attributes that define an object of a particular class, in this case the class A has an attribute called numeroEntero. The attribute is a concept that defines an object of a particular class, while a variable is used to support the procedures and objects not defined conceptually. Text is available under the Creative Commons Attribution ShareAlike 3. 0, additional terms may apply. Read Terms of Use for more information. . . .