Literals
C# and Java both support the same categories of literal values. No differences exist between the Boolean and Null literals in either language. Table 4-12 summarizes the key differences between Integer, Real, Character, and String literals.
Table 4-12. Literal Values
Category | Comments |
|---|---|
Integer | C# adds support for unsigned integer and unsigned long literals. |
C# does not support octal representations of integer literals. | |
Real | C# adds support for decimal literals. Use the M or m suffix to specify a decimal literal. |
Character | C# does not support octal escape sequences to represent characters. |
In C#, the escape sequence \0 represents null. | |
String | C# supports verbatim string literals. Preceding the string with the @ symbol causes the compiler not to interpret ... |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access