Interview Question
Qus: What are the different types of literals in dotnet.
Boolean literals: False or True are literals of the boolean type which map to the 0 and 1 state, respectively. Integer literals: Interger is used to have values of types Int, ulnt, long, and ulong. Real literals: Real is used to have values of types float, double, and decimal. Character literals: character represents a single character and usually consists of a character in single quotes, such as ‘a’. String literals: Dotnet supports 2 types of string literals, regular string literal and verbatim string literals. A regular string consists of zero or more characters within the double quotes, such as “543234”. A verbatim string literal is of an @ character followed by a double–quote character, such as @”This is litrals”. The Null literal: Represents the null–type.
Integer Literals
Floating-point Literals
Character Literals
String Literals
Null Literals
Boolean Literals