The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
January 2001

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Yes, It is right way

Posted by Kishori Sharan on January 30, 2001 at 3:33 PM

Hi Sunil
null word used in java is not a keyword. It is a literal of type null. However, the type itself has no name , so you cannot create and object of null type.You can just use the literal null of this type. This is th eonly way to check if an object reference has null reference in it.
if ( ref == null ) {
}
Thanx
Kishori



Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us