- Variables stores data for processing.
- A Variables is given a name (or identifier ) such as area , height ,etc.
- The name uniquely identifies each variable assigning a value to the variable & retrieving the valued stored.
Variables have types :-
- int : for integer (whole numbers) such as (123 and -567).
- float : for fractional parts such as 45.6 , 2.7 ,
- double : for floating point or real numbers with optional decimal points & fractional point is fixed or scientific notations such as 3.454, -45.67 .
- String : text strings are enclosed in double quotes.e.g String name = “Crazy”.
- char : holds only single character.
- boolean : holds only two values true or false.
DATA TYPES :Data Types in Java are divided into two categories Primitive and Non–Primitive.
Note:-Java does not support the concept of unsigned types and therefore all java values are signed.