Java Primitive Data Types
Java is a strongly-typed language. Variables must be explicitly declared with their type:
int age = 28;
double salary = 85000.50;
boolean isActive = true;
char grade = 'A';
String name = "Alex Morgan"; // Reference Type
// Type Casting (Widening & Narrowing)
double converted = age; // Automatic widening (int to double)
int truncated = (int) salary; // Explicit narrowing (double to int)