Numeric Types Overview
The integer types store numbers without decimal places.
byte
data type
The byte data type store values in the range from -128 to 127, which is to . You would use the byte data type if you know your number would be within the range of -128 to 127. It saves memory in large arrays.
byte maximumUsersPerGroup = 120;
short
data type
The short data types stores values in the range from -32768 to 32767, which is to .
short maximumMessageLength = 5000;
int
data type
The int data type store values in the range from to
int currentUsersOnline = 9300;
long
data type
It stores values in the range from to . An integer literal is of type long if it ends with the letter L or l.
long bigNumberWithoutDecimal = 68719476736;
Optionally you can prefix it with the letter L or l. Try to avoid using the lowercase l as it can be mistaken with the value 1.
long maximumCharacters = 140L;
char
data type
The char data type can contain a single unicode character enclosed in single quotes(''). Its represented internally as a number.
char correctAnserOption = 'A';
//Using an int number
char atSign = 64;