Qus:    What are the different types of literals in dotnet.
Nov 30, 2020 13:35 2 Answers Views: 93 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 08: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 09: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 course is right for you?

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


Let`s Connect