wood burning stoves 2.0*
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 Murach's Java Servlets and JSP this week in the Servlets 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: 12759
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 ""
Similar Threads
Set Chained OFF error while executing from my Bean
UB find method - OR or AND
RequestDispatcher not working properly in Websphere
how to create a null type
null pointer