Variables in java

Variables  in java

variables are basically identifier which used to store data value
variables are not constant we can change the value of variable during the execution of program
variable name should be related to your program
ex.  Program for addition of two number
class ADD
{
public static void main(String args[])
{
int a=3,b=5,add=0;
add=a+b;
System.out.println(+add);
}
}
In above program
a , b, add are the variables
a=3; mean variable ‘a’ initialize with value 3
add=a+b;
its mean addition of variable a & b stored in variable
table

No comments:

Post a Comment