How to get the object class in Java?
===

What is the best way to get the class of an instance ?

What is the recommended way ? and what are the differences (performances) between :

 - Compare the class

`if( this.getClass().equals(MyClass.class) ){` 
which seems to be the same as `this.getClass() == MyClass.class`   (or perhaps using  `Class.forName("com.test.MyClass")`)

 - Test the instance of *(seems to be the more readable)*

        if( this instanceof MyClass ){

 - Test the instance using class

        if( MyClass.class.isInstance(myInst) ){

