In Java, primitive types are the most basic type of data that can be used to store simple values. There are eight primitive types in Java, which are:
1. byte - 8-bit signed integer data type.
Example: byte age = 25;
2. short - 16-bit signed integer data type.
Example: short temperature = -10;
3. int - 32-bit signed integer data type.
Example: int number = 42;
4. long - 64-bit signed integer data type.
Example: long distance = 1000000L;
5. float - 32-bit IEEE 754 floating point data type.
Example: float price = 4.99f;
6. double - 64-bit IEEE 754 floating point data type.
Example: double pi = 3.14159265359;
7. boolean - boolean data type represents two possible values: true and false.
Example: boolean isRaining = true;
8. char - 16-bit Unicode character data type.
Example: char grade = 'A';
In the example code, variables are declared and initialized with different primitive types. The variable names can be chosen freely, but they should be informative. Note that the long and float types require a suffix (L and f, respectively) to distinguish them from other types.