1public class MyClass{
2 //...
3}
4
5Object m=new MyClass();
6Object o=new Object();
7boolean mInstanceOf=m instanceof MyClass;//true
8boolean oInstanceOf=o instanceof MyClass;//false
9boolean misInstance=MyClass.class.isInstance(m);//true
10boolean oisInstance=MyClass.class.isInstance(o);//false