C Books Guide and List
C++ Books Guide and List
Best Java Books

3,749 questions

4,049 answers

114 comments

10,705 users

What are the different types of literals?

0 votes
28 views
asked Feb 24, 2014 by sara Guru (24,570 points)

1 Answer

0 votes

 

 
A literal is a textual representation of a particular value of a type.
 
The different types of literals in Visual Basic are:
Boolean Literals - Refers to the True and False literals that map to the true and false state, respectively.
Integer Literals - Refers to literals that can be decimal (base 10), hexadecimal (base 16), or octal (base 8).
Floating-Point Literals - Refers to an integer literal followed by an optional decimal point By default, a floating-point literal is of type Double.
String Literals - Refers to a sequence of zero or more Unicode characters beginning and ending with an ASCII double-quote character.
Character Literals - Represents a single Unicode character of the Char type.
Date Literals - Represents time expressed as a value of the Date type.
Nothing - Refers to a literal that does not have a type and is convertible to all types in the type system.
 
The different types of literals in C# are:
Boolean literals - Refers to the True and False literals that map to the true and false states, respectively.
Integer literals - Refers to literals that are used to write values of types int, uint, long, and ulong.
Real literals - Refers to literals that are used to write values of types float, double, and decimal.
Character literals - Represents a single character that usually consists of a character in quotes, such as 'a'.
String literals - Refers to string literals, which can be of two types in C#:
A regular string literal consists of zero or more characters enclosed in double quotes, such as "hello".
A verbatim string literal consists of the @ character followed by a double-quote character, such as @"hello".
 
The Null literal - Represents the null-type.
 
answered Feb 24, 2014 by keem Expert (13,240 points)

Related questions

0 votes
1 answer 23 views
23 views asked Feb 24, 2014 by sara Guru (24,570 points)
0 votes
1 answer 31 views
0 votes
1 answer 73 views
73 views asked Oct 15, 2011 by arnav Sr Member (1,250 points)
0 votes
1 answer 34 views
34 views asked Feb 24, 2014 by sara Guru (24,570 points)
0 votes
1 answer 383 views
383 views asked Nov 16, 2011 by shivani Sr Member (1,090 points)
...