Data types
Data Types
- byte
- used to store the small digit numbers
Range = -128 to 127 - short
- used to small numbers
Range = -32768 to 32767 - int
- used to store integer values
Depends upon processor - char
- used to store any single character
uses 2 bytess in java and 1 byte in C - float
- used to store the decimal values upto 6 decimals
Place 'f' after the last digit of the number - double
- used to store the decimal values upto 8 - 10 decimals
- long
- used to large numbers
Place 'L' after the last digit of the number
NOTE:-
If we the given range is exceed its range value then
it comes from lower to upper range repeatedly
Example : -
byte a=128;
byte b=130;
System.out.println(a+" "+b);
output :-
-128 -126
byte b=130;
System.out.println(a+" "+b);
output :-
-128 -126