What is Variable
Actually, the term of variable in general will have a similar understanding with the variable exist in mathematics. In mathematics, A variable is a quantity that may change within the context of a mathematical problem or experiment. Typically, we use a single letter to represent a variable. The letters x, y, and z are common generic symbols used for variables. So, using that understanding further ahead, that term of the variable will also become the base understanding for the variable definition in programming language.
Variable in Programming Language
What is variable in the context of programming language ?. Generally, a variable is an element in a programming language which is dynamic. The content or the value of the variable can be vary and it may change in the lifespan of a running application or system where the variable exist.
One of the reason for the change is because of the process which is the definition for how the process itself run exist in a function, method. That function or method is part of the source code which is defining the running application or system itself.
So, the variable will change accordingly depend on the process exist as the application or system running. The function or method describing the method will further process the variable and it may ends with the change of the value of the variable.
As an analogue, variable looks like a shopping basket where the content of that shopping base is possible for further changes depend on the shopping need. But in the case of the type of the variable, a simple variable can only store one item. On the other hand, a more complex variable can store more than one item with a different type of item just looks like a shopping basket.
Normally, every type of programming language will have a variable. The main difference between one type of programming language with another is that those programming languages will have different type of variable from one another.