Variables

As stated earlier,every class definition consists of both variable and methods.A variable is a name for memory location that stores a specific value.this value may change during program execution,which is why it’s called a “variable”.
1.local variable:It is declared within the body of a method.then you can use within the method.
2.global variable:it is a variable that is declared at the start of the code and is used in all part of program.

Variables
Translate »