When I compile and run this code:
public class Testing {
public static void main(String... args) {
Object obj = null;
if (obj instanceof Object) {
System.out.println("returned true");
} else {
System.out.println("returned false");
}
System.out.println(" " + obj instanceof Object);
}
}
I get this on the command line:
C:\Users\xxxxxx\Desktop>java Testing
returned false
true
Shouldn't "null instanceof someType" always return false?