java
Variable
-A variable can be define as a memory location that stores an data value of a certain type.
-A variable consists of a data type along with a suitable name.
-Assigning a value for a variable for the first time is called initializing a variable.
example int age;
output
first we took integer the declare its value and then print the output.
Constant
-The difference between a constant and a variable is that the value held by a variable can be changed throughout the problem execution . but after a constant has been initialized we can not change the value in it.
example final double pi 21/7
output
ERROR , because we have already declared the value of PI.
Nice
ReplyDeleteSuperrb...👌👌
ReplyDeleteNice
ReplyDelete