Skip to main content

Built-in DataTypes

In the process of solving any problem, you might need to work with different type of inputs. 


Java has 8 built-in datatypes (primitive datatypes) : 

byte, short, int, long, float, double, boolean, char


byte : used to store numbers from -128 to 127

short : used to store numbers from -32,768 to 32767

int : used to stores numbers from -231  to  231 - 1

long : used to store numbers from -263  to  263 - 1

float : used to store decimal point numbers (32-bit) (Ex : 5.26)

double : used to store decimal point numbers with double precision (64 - bit) 

boolean : used to store only two values [true, false]

char : used to store a single character (Ex : w)

NEXT

Comments