In any programming language, there is a way to store information in computer memory. Suppose we want to find out sum of two numbers, then we need to get those numbers as input and store them in memory to carry out the calculation and again the result could be stored in some memory location and shown as output on screen.
Data storage is a technique using which we store data in computer's memory and we name that memory location for our convenience. Whenever we store any data it is stored in memory at any address as provided by the operating system and this memory location is marked by a name which we give in our software code. This naming of memory address helps us to work smoothly without going deeper into the hardware and operating system mechanism of memory management and we feel like solving an algebra problem for example x=3; y=4; sum=x+y;
There are two type of Data storage based on the capacity to edit/change the information: Variables and Constants
Variables are the data storage which could be changed or assigned new data/information, as and when needed.
Constants are the data storage which can not be changed or assigned once it is initialised or defined.
Basic Data Types in Java