Java/my notes

ph
Admin (토론 | 기여)님의 2011년 4월 5일 (화) 00:42 판
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)
이동: 둘러보기, 검색

The Java programming language also supports a few special escape sequences for char and String literals: \b (backspace), \t (tab), \n (line feed), \f (form feed), \r (carriage return), \" (double quote), \' (single quote), and \\ (backslash).

Finally, there's also a special kind of literal called a class literal, formed by taking a type name and appending ".class"; for example, String.class. This refers to the object (of type Class) that represents the type itself.

int x4 = 5_______2; // OK (decimal literal)
int x6 = 0x_52; // Invalid; cannot put underscores at the beginning of a number
int x9 = 0_52; // OK (octal literal)