This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes A query on keywords Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "A query on keywords" Watch "A query on keywords" New topic

A query on keywords

Rubayat Islam

Joined: Feb 11, 2007
Posts: 6
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?

    Silence is the true Friend that never betrays...
    Sunil Vasudevan
    Ranch Hand

    Joined: Mar 05, 2007
    Posts: 107
    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:

    Sunil.V<br />SCJP2, SCWCD1.4, SCBCD1.3
    It is sorta covered in the JavaRanch Style Guide.
    subject: A query on keywords
    Similar Threads
    IMP!- can, boolean literals (true, etc),unused reserved words,BE CALLED Keywords ?
    Reserved Words vs Keywords
    Keywords and reserved words in Java
    Reserved words
    Reserved words vs. keywords