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://www.cnblogs.com/gisoracle/p/6388798.html