This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Null and ""

 
Art DeSeve
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are null and "" the same thing? I thought they were but now I am wondering.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13048
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
They most certainly are NOT the same thing.
null is a special literal value used to indicate an un-initialized reference. Instance variables are initialized to null. If you try to perform an operation on an object reference that has the null value you get a NullPointerException.
"" is a String object that has zero characters it it.
Bill

 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic