"Java/my notes"의 두 판 사이의 차이

ph
이동: 둘러보기, 검색
(새 문서: 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), \...)
 
 
1번째 줄: 1번째 줄:
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).
+
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.
+
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)<br>int x6 = '''0x_52; // Invalid'''; cannot put underscores at the beginning of a number<br>int x9 = '''0_52; // OK''' (octal literal)

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)