Add

Tuesday, August 4, 2009

Identifiers and Variables

Identifier
An identifier is a name for something, a way to identify it. Objects, variables,fields and functions all have identifiers. These Identifiers must be used whenreferring to these entities. Not all items found in a program have Identifiers.Among those that do not are constants, operators and certain reserved words.Instead, these items are referred to directly. One way to understand thedifference is that those programming elements that refer to something storedelsewhere in memory require an identifier to access them, while those that existin the programming code itself and do not refer to anything outside, do notneed an Identifier.
Variable
A variable is the reference to a data value that can vary while the user isrunning the application. A variable refers to an actual location in memory inwhich data is stored. A variable has a name, also called the identifier, whichthe programmer uses in the program rather than an actual memory address. Avariable also has a data type, which describes the kind of data that can bestored in that memory address. Finally, a variable has a value, which is theactual data currently stored in that memory address.

No comments: