Java - How to find the class an Object is part of
<p>Is there any way in Java to find the class an object is part of?</p>

<pre><code>class WrapperClass
{
    SomeObject o;
    ...
    someMethodOfWrapperClass()
    { ... }
}

[...]

SomeObject foo = new SomeObject();
WrapperClass wrap = new WrapperClass();
wrap.o = foo;
</code></pre>

<p>Is there any way to find the corresponding WrapperClass object <code>wrap</code> from <em>within</em> the SomeObject object or one of it's methods?<br>
Something along the lines of:</p>

<pre><code>foo.getWrapperClassObject().someMethodOfWrapperClass();
</code></pre>

<p>Thanks you very much in advance!!</p>

<p>Thomas</p>
