• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

keyword vs. reserved word

 
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the difference between keyword and reserved word? For ex, true/false/null are reserved words but not keywords.
 
Ranch Hand
Posts: 2412
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually true/false/null are not reserved words. true and false are Boolean literals, and null is the null literal. const and goto are keywords that are reserved. That is, they are keywords, but they aren't used.
[ October 18, 2006: Message edited by: Keith Lynn ]
 
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Keith Lynn:
Actually true/false/null are not reserved words.



Hmm...there's a Sun tutorial that says, "true, false, and null are not keywords but they are reserved words"http://java.sun.com/docs/books/tutorial/java/nutsandbolts/_keywords.html. Presumably, then, the reserved words are the keywords plus the boolean and null literals.

See also:
http://forum.java.sun.com/thread.jspa?threadID=741032&messageID=4249727

Practically speaking, I don't suppose the distinction matters a great deal; we can't use any of them for identifiers in Java, and that's the important point.
 
So it takes a day for light to pass through this glass? So this was yesterday's tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic