C and Java types

Table 2. size differences

char16 bits8 bits
short16 bits16 bits
int32 bits16,32 or 64 bits
long64 bits32 or 64 bits
float32 bits32 bits
double64 bits64 bits
boolean1 bit1 bit or int
byte8 bitsuse char
long longN/A64 bits
long doubleN/A80,96 or 128 bits

C used to have no boolean types but the C99 standard introduced this type.

Note

With the sizeof keyword one can get the size of a C type in a certain runtime environment.

int size = sizeof(int);

would return either 2, 4 or 8 (bytes).