Re: What Are Variables? (Java Question)reply by Srirangan Okay, this is the last time I'm gonna answer your homework question.. ;-)
So what is a variable?
# It is simply a place in your computer?s memory where you can store information that can be manipulated in your program.
What type of data is stored in a variable?
# The type of data stored depends on the data type of the variable. A variable can store characters, like a letter to your Mother, or number, like in a letter to the IRS or true or false values.
Is the same variable used throughout the program?
# No, variables have scope. The scope is the portion of the code in which the variable is defined and its data can be accessed. When the variable goes out-of-scope, the program can no longer access its data. By correctly defining a variable?s scope, the same name can be used several times in the same program with no ill effects.
Post reply
Subscriptions
Got a Programming Question?
Just Sign Up and ask the top Programming experts!
|