methodvariable
nounUK /ˈmɛθədˌvɛəriəbl/
US /ˈmɛθədˌvɛriəbl/
A method variable is a special box inside a computer program that holds a value for one part of the program to use.
The programmer stored the player's score in a method variable so the game could update it.
OTHER MEANINGS
2. A variable declared inside a method that only exists while that method is running.
Once the method finished, the method variable disappeared from memory.
3. A named storage location used by a subroutine to keep track of changing data.
She used a method variable to count how many times the loop repeated.
4. In some programming languages, a variable that belongs to a specific method rather than the whole class.
Unlike a class field, a method variable cannot be seen by other methods.