DEV Community

pranavinu
pranavinu

Posted on

DATATYPES

Datatypes:

1) Datatypes says that, what kind of values of the datatypes to be store in a variable
2) Premitive and Non-Premitive are the types of the datatype

Premitive datatypes :

1)Premitive datatype are pre defined datatypes , the size of the premitive datatypes are fixed
2)The Premitive datatype consist of 8 types and each datatypes has a different size

byte - 1byte - It stores numeric values
short - 2byte - It stores numeric values
int - 4byte - It stores numeric values
long - 8bype - It stores numeric values
float - 4byte - It stores decimal values
double - 8byte - It stores decimal values
char - 1byte - It stores single char ''
boolean - 1bit - It stores true or false

Non-Premitive datatypes:

1)Non-Premitive datatypes consist of string values, where string is a pre defined class
2)It doesn't depends upon any sizes

string:
1)The values of the strings were store in between " "
2)In a class, string allows to store any values of the datatypes in variable
3) It stores the multiple char " "

Top comments (0)