Qus:    What are the different types of literals in dotnet.
Nov 30, 2020 19:35 DotNet 2 Answers Views: 1248 DIVYA

 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.

Prev Next
Answers (2)
PARTH Dec 01, 2020 14:03
Answer:   Literals are of the following types-

Integer Literals
Floating-point Literals
Character Literals
String Literals
Null Literals
Boolean Literals

PADMAKEECHU Dec 01, 2020 15:04
Answer:   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.

Post Your Answer
Guest User

Not sure what solution is right for you?

Choose the right one for you.
Get the help of the experts and find a solution that best suits your needs.


Let`s Connect