Methods A and B call method C. Now how to find out inside C who called it?
<p>I have some code in method C that will get executed based upon the who called it. </p>

<pre><code>public void C()
{
    if(A called me) { .... }
    if(B called me) { .... }
}
</code></pre>

<p>One way is to use a flag variable. Set the variable before calling C and then inside C process the flag.</p>

<p>Any other ideas?</p>
