1l为长,1f为浮点,1d为双,什么字节?

1l为长,1f为浮点,1d为双,什么字节?

问题描述:

1l for long,1f for float,1d for double,what about byte?

1l for long, 1f for float, 1d for double, what about byte?

long l = 1l;
float f = 1f;
double d = 1d;
// byte b = 1?;

byte 是否存在?

不,没有后缀可以附加到数字文字,使其成为 byte

No, there is no suffix you can append to a numeric literal to make it a byte.

请参阅 3.10文字在Java语言规范中。

See 3.10 Literals in the Java Language Specification.