Literal Assignment in Java [duplicate]
问题 This question already has answers here : Java's L number (long) specification (6 answers) Closed 3 years ago . what's the difference in defining double example = 23.1d or double example = 23.1 Why long, float and double can end with l, f, d? 回答1: There is no difference between double example = 23.1d; and double example = 23.1; because a floating point literal without a type suffix is always interpreted as a double. The type suffixes are necessary in order to avoid ambiguities in certain