Types of Datatypes in Java

Different types of datatypes in Java are

byte

short

int

long

float

double

boolean

char

1 byte = 8 bits.

boolean is the datatype which uses very less memory out of all.

Remember to use correct suitable datatypes in your program. It is one of the factor for speed and efficiency of a program.


What is a variable or datatype and why they are used detailly ?