Home >Java >Javagetting Started >How many bytes does the long type occupy in java?

How many bytes does the long type occupy in java?

王林
王林Original
2019-11-12 13:47:4510319browse

How many bytes does the long type occupy in java?

The so-called number of bytes occupied is the amount of space occupied when applying for memory.

long 8 bytes

The minimum value is -9,223,372,036,854,775,808 (-2^63);

The maximum value is 9,223,372,036,854,775,807 (2^63 -1 );

Bytes occupied by other types in java:

##byte 1 byte

The minimum value is -128 (-2^7);

The maximum value is 127 (2^7-1);

boolean At least 1 byte

This type is only used as a flag to record true/false situations;

short 2 bytes

The minimum value is -32768 (-2^ 15);

The maximum value is 32767 (2^15 - 1);

char 2 bytes

The minimum value is\u0000 (i.e. is 0);

The maximum value is \uffff (that is, 65,535);

int 4 bytes

The minimum value is -2,147,483,648 (- 2^31);

The maximum value is 2,147,483,647 (2^31 - 1);

float 4 bytes

Single precision floating point number 32 bits long, mantissa length 23, exponent length 8, exponent offset 127;

double 8 bytes

Double precision floating point number is 64 bits long, mantissa Length 52, exponent length 11, exponent offset 1023;

Recommended tutorial:

Java tutorial

The above is the detailed content of How many bytes does the long type occupy in java?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn