File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Literals !!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Literals !!!" Watch "Literals !!!" New topic

Literals !!!

Ganesh Kumar
Ranch Hand

Joined: Jul 02, 2007
Posts: 113
Hi friends
Can anyone tell me the meaning of literals?? And also what String,Char literals means???

Shoumin Li
Ranch Hand

Joined: Jul 06, 2007
Posts: 85
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 ]

Java Blog
Ganesh Kumar
Ranch Hand

Joined: Jul 02, 2007
Posts: 113
Sorry li.Can you little more clear.I didnt get you
vanlalhmangaiha khiangte
Ranch Hand

Joined: Sep 11, 2006
Posts: 170
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.


2000 0 -7

3.14 -3.14 .5 0.5

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

true false

"abba" "3.14" "for" "a piece of the action"
I agree. Here's the link:
subject: Literals !!!
It's not a secret anymore!