Data Types
Data Types
Variables,
and Arrays
S.REVATHI AP/CSE
Java Is a Strongly Typed Language
Java is a strongly typed language-Safety and Robustness
Every variable has a type, every expression has a type, and every type is
strictly defined
Every assignments, whether explicit or via parameter passing in method
calls, are checked for type compatibility.
The Java compiler checks all expressions and parameters
Any type mismatches are errors that must be corrected before the compiler
will finish compiling the class.
The Primitive Types
Byte
short Integers Floating-point Characters Boolean
numbers
int
Long byte, short, int, float and char true/false
and long double
char
float
double
boolean
Integers
CODING DEMOS
Floating-Point Types
Character
The range of a char is 0 to 65,536
CODING DEMOS
CODING DEMOS