The instanceof operator compares an object to a specified type. You can use it to test if an object is an instance of a class, an instance of a subclass, or an instance of a class that implements a particular interface.
http://download.oracle.com/javase/tutorial/java/nutsandbolts/op2.html