Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
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?
 
Sheriff
Posts: 5879
833
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.
 
Marshal
Posts: 58378
178
  • 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 . . . "

 
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!