After completing our first program we will study about variables and data types in java. First we will look at variables then we will move towards data types.
Variables are use to store some value while execution of program. For example you want to add two number it mean you should have two numbers to add. so you can store these to numbers in variables. Example of define and initialize variable in Java.
A Data type identifies a set of values and their representation in memory and set of operations that transform these values into other values that set. Java is strongly typed language. It mean you can write any variable without mentioning its data type. There are two types of data types in java.
Primitive Types:- Which is given by keyword to us in java like int, char, float etc. You can also say it predefined or built in data types.