Java Basic

Datatypes and Variables

views

03:20
A variable is a place in the memory of a computer which is assigned to a value so that it can be used further in the Java program. You can also think of variable as a vessel which holds the value so that the user can use it, while you are at JAVA program. Every variable in Java program has its own type, size of the memory and the operations which can be performed on the variables. While using any variable it is essential that we declare its data type. You must always declare a variable before it is being used. Question arises here,” What is data type?”