Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Beginning Java and the fly likes what is Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Beginning Java
Bookmark "what is "literal" means ?" Watch "what is "literal" means ?" New topic

what is "literal" means ?

Nakata kokuyo
Ranch Hand

Joined: Apr 13, 2005
Posts: 457
hi, can someone please tell what exactly means when the term "literal" use in programming world that means of constant or string?
marc weber

Joined: Aug 31, 2004
Posts: 11343

According to section 3.10 of the Java Language Specification, "A literal is the source code representation of a value of a primitive type (�4.2), the String type (�4.3.3), or the null type (�4.1)."

So basically, a literal is a specific value in the source code. For example, in the line int x = 10;, the "10" is an int literal. Or in the line System.out.println("abc");, the "abc" is a String literal.

"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
Nakata kokuyo
Ranch Hand

Joined: Apr 13, 2005
Posts: 457
thank you , marc weber
Have you checked out Aspose?
subject: what is "literal" means ?
jQuery in Action, 3rd edition