• Post Reply Bookmark Topic Watch Topic
  • New Topic

Is null a keyword......  RSS feed

 
Bharath Chinnadurai Maharajan
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

is 'null' a keyword or not. If its not a keyword then why it is not possible to say

String null = "Stuk in null....."

-bharath chinnadurai
 
samdeep aarzoo
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
according to java lang specification
null , true , false are literal values
and are not keywords
so u cant create a identifir by these literal values
if u try to create an identifier with one of these literal values
u will get a compile error
 
Philip Heller
author
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
null isn't technically a keyword, but it's almost the same thing: it's a word that has special meaning to the compiler, so you aren't allowed to use it as an identifier.
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it's a reserved word but not a keyword
 
Bharath Chinnadurai Maharajan
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for those replies....

=======
bharath chinnadurai
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!