Is there any way to know the caller class name?
<p>Lets say I have a method  <code>classA.methodA()</code> and its calling <code>classB.methodB()</code>. Now, inside the <code>classB.methodB()</code>, is there any way to know that its being called by <code>classA</code> (without passing any explicit info). I know this info is there in Java Runtime. My question is how to get the the class name of callee method ? </p>

<p>to make it more obvious </p>

<pre><code>ClassA{

methodA(){
  ClassB b = new ClassB();
  b.methodB();

}

}


ClassB{

methodB(){
  // Code to find that its being called by ClassA
}

}
</code></pre>
