What are VARIABLES in programming language...?

Whether java or python, or in any of the programming language, there is a concept of variables.
Variables are simply names used to refer to some location in memory – a location that holds a value with which we are working. It may help to think of variables as a placeholder for a value. 
In simple language, for understanding variables, we can express it as a cup.

Variable is just a cup, A container. It holds something.
The way cup can be used to hold different things, in the same way a variable can also hold any value , whether it is an integer value or any floating point or any string.

Now, coming upon different sizes of variables. A bigger cup holds larger memory and a smaller cup holds small memory. Hence, we can say that the cup holding an integer value is smaller than that of holding a floating point number.
The fact that a double type of value cannot be stored in an integer variable may be explained by knowing the fact that WE CANNOT FIT A GIRAFFE IN THE CONTAINER MADE FOR A CAT.  I think it sounds pretty obvious and hence true.
I think now there would be no doubts in your minds regarding the concept of variables.😊😊
If there are any doubts you can ask me in the comments section below.

Comments

Popular posts from this blog

Introduction

Making a Multiplayer Tic Tac Toe game using JAVA