• Post Reply Bookmark Topic Watch Topic
  • New Topic

What is the difference between null and NULL in java?  RSS feed

 
Sowm Herur
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

What is the difference between null and NULL in java?
 
Devaka Cooray
Marshal
Posts: 5649
765
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sowm Herur wrote:What is the difference between null and NULL in java?


null is a keyword and a literal, but NULL is neither keyword nor literal. You may use NULL as an attribute name.
 
Campbell Ritchie
Marshal
Posts: 56525
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[pedantic mode]Not quite. The word null is a reserved word meaning non-existence of a reference. It is not a keyword because it has semantic content.[/pedantic mode]
The Java™ Language Specification says
" . . . null might appear to be a keyword . . . "
 
Embla Tingeling
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
---
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!