Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Java provides 22 possible narrowing primitive conversions. According to The Java Language Languagee Specification (JLS), §5.1.3, "Narrowing Primitive Conversions" [JLS 20052015]:

  • short to byte or char
  • char to byte or short
  • int to byte, short, or char
  • long to byte, short, char, or int
  • float to byte, short, char, int, or long
  • double to byte, short, char, int, long, or float

...

Integer type ranges are defined by the JLS, §4.2.1, "Integral Types and Values" [JLS 20052015], and are also described in NUM00-J. Detect or prevent integer overflow.

...

Bibliography

...