且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

双字段类型声明为零

更新时间:2022-06-23 22:49:31

没有区别。看看 Java语言规范,第3.10.2节

There is no difference. Have a look at the Java Language Specification, section 3.10.2



DecimalFloatingPointLiteral:


  1. 数位。数位 opt ExponentPart opt FloatTypeSuffix opt

  2. 。数字ExponentPart opt FloatTypeSuffix opt

  3. 数字ExponentPart FloatTypeSuffix opt

  4. Digits ExponentPart opt FloatTypeSuffix

  1. Digits . DigitsoptExponentPartoptFloatTypeSuffixopt
  2. . Digits ExponentPartoptFloatTypeSuffixopt
  3. Digits ExponentPart FloatTypeSuffixopt
  4. Digits ExponentPartoptFloatTypeSuffix


...


FloatTypeSuffix:

f F d D



都是一个 DecimalFloatingPointLiteral ,第一个类型1,第二个类型4

Both are a DecimalFloatingPointLiteral, the first one type 1, the second one type 4