what is variable declaration code example
Example 1: what is declaration of variable
declaration of variable just means defining that a variable of given data type is needed and hence compiler creates a memory block for such a variable based on its data type.
In Java, int n;
Example 2: use declaration to define a variable
int x;
double y;
string someMeaningfulName;