• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Literals !!!

 
Ganesh Kumar
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends
Can anyone tell me the meaning of literals?? And also what String,Char literals means???

Thanks
 
Shoumin Li
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Literal,in programming, a value written exactly as it's meant to be interpreted.
A character literal is expressed as a character or an escape sequence, enclosed in ASCII single quotes.
A string literal consists of zero or more characters enclosed in double quotes.
[ July 16, 2007: Message edited by: Shoumin Li ]
 
Ganesh Kumar
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry li.Can you little more clear.I didnt get you
 
vanlalhmangaiha khiangte
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A literal denotes a constant value, that is, the value a literal represents remains unchanged in the program. Literals represent numerical (integer or floating-point), character, boolean or string values. In addition, there is the literal null that represents the null reference.

Example

Integer
2000 0 -7

Floating-point
3.14 -3.14 .5 0.5

Character
'a' 'A' '0' ':' '-' ')'

Boolean
true false

String
"abba" "3.14" "for" "a piece of the action"
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic