字面

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 文字應使用大寫字母 L 字尾。
  • 十六進位制文字應使用大寫字母 A-F。
  • 所有其他數字字首,中綴和字尾應使用小寫字母。