This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

A query on keywords

 
Rubayat Islam
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The words
  • true
  • false
  • null
  • are not enlisted in the complete list of keywords of the K&B book, page 6. It should mean that i can use these as identifiers in my code. But complier detects error if i do so. Why aren't these words enlisted in the list then?
     
    Sunil Vasudevan
    Ranch Hand
    Posts: 107
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Null, false and true are not listed in reserved keywords cause they are actually literals. Hence cannot be used as an identifier.

    And FYI, literals are constant value (String or number) used in Java programs.

    A link to a good read is provided below:
    http://java.sun.com/docs/books/tutorial/java/nutsandbolts/datatypes.html
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic