File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "null instanceof aclass" Watch "null instanceof aclass" New topic

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 ?

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

Joined: Jul 08, 2003
Posts: 24195

It always evaluates to false, not to true.

[Jess in Action][AskingGoodQuestions]
I agree. Here's the link:
subject: null instanceof aclass
It's not a secret anymore!