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 represents null.

String

C# supports verbatim string literals. Preceding the string with the @ symbol causes the compiler not to interpret simple, hexadecimal, or Unicode escape sequences within the string. This is useful when working with directory and file names and regular expressions.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset