data types

Primitive types are the most basic data types available within the Java language. There are 8: boolean , byte , char , short , int , long , float and double . These types serve as the building blocks of data manipulation in Java. Such types serve only one purpose — containing pure, simple values of a kind.

Here is what the above code is Doing:
1. We created a byte variable named myNum and assigned the value 127 to it.
2. We created a short variable named myNum and assigned the value 32767 to it.
3. We created an int variable named myNum and assigned the value 2000000000 to it.
4. We created a long variable named myNum and assigned the value 9223372036854775807 to it.
5. We created a float variable named myNum and assigned the value 3.14 to it.
6. We created a double variable named myNum and assigned the value 3.141592653589793 to it.
7. We created a boolean variable named myNum and assigned the value true to it.
8. We created a char variable named myNum and assigned the value ‘A’ to it.