At the risk of giving away the plot, "instanceof" is an operator, just like "+". except that it has a longer name.
It's a binary operator, so like the '%" operator. it has a left-hand side and a right-hand side. The left-hand side of "instanceof" is an object. The right-hand side is the name of a class, which can either be simple ("String") or fully-qualified ("java.sql.Date"). The output of this operation will be a binary value (true/false).
One thing that might not be intuitive is that a "class" is not just literally a class, but in
Java, so is an Interface.
Thus, if you say "a instanceof Foo", then you are checking to see if "a" is either an actual instance of class Foo OR an instance of a class which has Foo as a parent class OR the class that a actually belongs to (or one of its parents)
implemenents Foo.
Thus,
instanceof is a very powerful operator as it allows you to check whether an object has certain properties or methods without you having to use introspection to peer into its innards. I can feed it it an object that has been down-cast to generic
java.lang.Object and easily tell if I can do "Foo" things with it, regardless of whether it's a FooUp, a FooDown, a DummyFoo and know that I can't do Foo things if the object was actually a Bar.