Java – how to create a long value with all bits = 1
•
Java
I tried the following methods:
public static final long DEVICE_ID_UNKNowN = 0xFFFFFFFFFFFFFFFF;
But it can lead to
The literal 0xFFFFFFFFFFFFFFFF of type int is out of range
Solution
Use 0xffffffffffffffffffffffl and there is no problem
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码