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

Reserved word and Key word

 
Parameswaran Thangavel
Ranch Hand
Posts: 485
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
whats the difference between the reserved word and keyword.
 
Ram Naresh
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
similarity is that both cannot be used as identifiers, difference is that reserved words like goto were not consider safe to use, so cannot be used. there are close substitutes like break,continue with labels for goto and public static final instead of const.

Ram
[ April 09, 2005: Message edited by: Ram Naresh ]
 
Raghu Shree
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
key words are nothing but reserve words. we can't use this as a identifiers for variable name,class name, method name etc., But one slight different between keyword and reserve word. goto and const are not keyword. if we use this compiler shows an error message. but we can't use this as a identifier. These type of words are called reserve words.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic