What is Variables in C#
Now we are going to learn about the variables and how many kind of the variables are there in C#.
A variables in a programming language can be compare to a store room, and is essential for the programmer. Variables represent storage locations and every variable stores same type of the variable. It is sure C-sharp compiler know that variables can stored in there appropriate location because of C-sharp is a type-safe language. But some cases values of the variables can change there by the assignment and ++,- - operators.
C# have seven type of variables.
- Static variables.
- Instance variables.
- Array elements.
- Value Parameters.
- Reference Parameters.
- Out put parameters.
- Local Parameters.
public static int x;
void f(int v,int a, ref int b, out int c
Here x is a Static variable, and Y is an Instance Variable,V is an array, a is value parameter, b is ref parameter, I is local parameter is output parameter.