• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

does java have key word restrict?

 
X Sun
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See below:
String String = "this is correct";
this assignment is correct.
I am impressed.
 
Harpal Singh
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear X,
String is a class not a keyword...so that is perfectlly fine........
Harpal
 
Tualha Khan
Ranch Hand
Posts: 287
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Absolutely True!!
String String="Hello";
The above statement in java just makes an object in java. It is not using any reserved words or keywords of java language.
try
int int=56;
Compiler gives an error, saying int in a keyword and cannot be used as an identifier.

Bye,
Tualha Khan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic