wood burning stoves
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Null and Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Null and """ Watch "Null and """ New topic

Null and ""

Art DeSeve

Joined: Nov 15, 2000
Posts: 5
Are null and "" the same thing? I thought they were but now I am wondering.
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13018
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.

I agree. Here's the link: http://aspose.com/file-tools
subject: Null and ""
jQuery in Action, 3rd edition