I am studying for java certification. And i'm curious about the java literals.
I know it is possible to do something like this:
int i = 0xAA;
long l = 0xAAL;
Also this is possible for floating-point variables:
double d = 123d;
float f = 123f;
So I logically thought with these examples that the same would apply for hexadecimal. Just like i can add L for long literals, I could add 'd' or 'f' but the logic is flawed since 'F' and 'D' are valid hexadecimal values.
It is not possible to do something like this:
double d = 0xAAAAAAAAAAAAAAAAAAd;
Is this just not allowed by Java or there is a simple way to do it that I don't know?
question from:
https://stackoverflow.com/questions/42722895/java-hexadecimal-base-double-literal 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…