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 instanceof aclass 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 instanceof aclass" Watch "null instanceof aclass" New topic
Author

null instanceof aclass

Giselle Dazzi
Ranch Hand

Joined: Apr 20, 2003
Posts: 168
I know I should remember this but I need to use it now and can you guys confirm to me if
null always evaluate true if we do an
null instanceof ClassWhatever ?
Thx


Giselle Dazzi<br />SCJP 1.4
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

It always evaluates to false, not to true.


[Jess in Action][AskingGoodQuestions]
 
Don't get me started about those stupid light bulbs.
 
subject: null instanceof aclass
 
Similar Threads
Casting a null object...
cast & instanceof
instanceof problem...scjp book page no.285
Clean way of checking if object type is primitive or String
null instanceof an Object ?