File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Null and """ Watch "Null and """ New topic
Author

Null and ""

Art DeSeve
Greenhorn

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
Rancher

Joined: Mar 22, 2000
Posts: 12803
    
    5
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
 
subject: Null and ""