Java long data type

When the integer type is too long, it is represented by the long type;

int = 109098098080800980; int means -2^31 to 2^31-1

long = 109098098080800980; long means -2^63 to 2^63-1

Note that assignment from intto longtype is valid because intall values ​​stored in a variable can be stored in longa variable of type. However, it is not necessarily the case, because the longtype data is larger than the inttype range. So you can't simply longassign the value stored in the variable to the intvariable. There is a possibility of value overflow.

 

 

 

 

Reprinted in: https://my.oschina.net/hellation/blog/3023294

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324103506&siteId=291194637