wood burning stoves 2.0*
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
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "A query on keywords" Watch "A query on keywords" New topic
Author

A query on keywords

Rubayat Islam
Greenhorn

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:
    http://java.sun.com/docs/books/tutorial/java/nutsandbolts/datatypes.html


    Sunil.V<br />SCJP2, SCWCD1.4, SCBCD1.3
     
    jQuery in Action, 2nd edition
     
    subject: A query on keywords
     
    Similar Threads
    Keywords and reserved words in Java
    Reserved words vs. keywords
    IMP!- can, boolean literals (true, etc),unused reserved words,BE CALLED Keywords ?
    Reserved Words vs Keywords
    Reserved words