Javaaaaa@A
Javaaaaa@A
Presented by
Indhumathi. J
Data Types in
Java:
Definition:
* Data types in Java define the type of data that can
be stored in variables. They specify the size and
type of values that can be held in variables,
helping to allocate the correct amount of memory.
* Purpose:
* To specify the kind of data a variable can
hold (e.g., integer, decimal, text, etc.).
To optimize memory usage and ensure type
safety (e.g., preventing operations between
incompatible data types).
Simple term’s:
*A data type tells the compiler what type of
value a variable will store and how much
memory it needs.
* For example, using int tells Java the
variable will hold whole numbers, while
String tells it to hold text.
Types of Data types: