Java Primitives: — Java language provides 8 primitive types to represent simple numeric, character and boolean values. Declare and Initialize Primitive Variables: Primitive declaration and initialization rules:
<type> <variable name> = <value>;
- Numeric values can be expressed as binary, octal, decimal and hex.
- Smaller types are automatically casted (promoted) to bigger types. …