Literals

Download java eBook

Example

long l = 5432L;
int i = 0x123 + 0xABC;
byte b = 0b1010;
float f1 = 1 / 5432f;
float f2 = 0.123e4f;
double d1 = 1 / 5432d;  // or 1 / 5432.0
double d2 = 0x1.3p2;
  • long literals should use the upper case letter L suffix.
  • Hexadecimal literals should use upper case letters A-F.
  • All other numerical prefixes, infixes, and suffixes should use lowercase letters.

Stats

Contributors: 1
2016-07-26
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook