Welcome to the World of Online Learning:
Hello Friends “This blog helps you to learn Java programming concepts. You can learn Java language at your own speed and time. One can learn concepts of Java language by practicing various programs given on various pages of this blog. Enjoy the power of Self-learning using the Internet.”

Write about Java Data Types (Primitive)
There are mainly 8 Primitive Data Types
Primitive data types are the basic and built-in types in Java.
Java has 8 primitive data types:
✅ 1. byte
-
Stores whole numbers
-
Size: 1 byte
-
Range: −128 to 127
-
Good for saving memory
Example:
✅ 2. short
-
Stores small whole numbers
-
Size: 2 bytes
✅ 3. int
-
Most commonly used
-
Stores normal whole numbers
-
Size: 4 bytes
✅ 4. long
-
Stores very large whole numbers
-
Size: 8 bytes
✅ 5. float
-
Stores decimal numbers
-
Size: 4 bytes
-
Must end with f
✅ 6. double
-
Stores big decimal numbers
-
Size: 8 bytes
-
More accurate than float
✅ 7. char
-
Stores a single character
-
Written in single quotes
✅ 8. boolean
-
Stores true or false
⭐ Full Program to Show All Primitive Data Types
public class DataTypesExample {
public static void main(String[] args) {
byte age = 20;
short distance = 1200;
int amount = 50000;
long population = 1400000000L;
float height = 5.7f;
double weight = 62.456;
char letter = ‘J’;
boolean isLearningJava = true;
System.out.println(“Age: ” + age);
System.out.println(“Distance: ” + distance);
System.out.println(“Amount: ” + amount);
System.out.println(“Population: ” + population);
System.out.println(“Height: ” + height);
System.out.println(“Weight: ” + weight);
System.out.println(“Letter: ” + letter);
System.out.println(“Learning Java: ” + isLearningJava);
}
}
OUTPUT:-
Age: 20
Distance: 1200
Amount: 50000
Population: 1400000000
Height: 5.7
Weight: 62.456
Letter: J
Learning Java: true