Overloads Done At Compile Time
<p>I was just reading this answer </p>

<p><a href="http://stackoverflow.com/questions/2037868/which-overload-is-called-and-how/2037885#2037885">http://stackoverflow.com/questions/2037868/which-overload-is-called-and-how/2037885#2037885</a></p>

<p>by Jon Skeet and I just done understand how overload resolution gets done at compile time - How is that possible??  You dont know the type of the object till you run??</p>

<p>I always thought that all method calls were done at run time (late binding)</p>

<p>What are the exceptions to that??</p>

<p>I ll give an example: </p>

<pre><code>public void DoWork(IFoo)
public void DoWork(Bar) 

IFoo a = new Bar();
DoWork(a)
</code></pre>

<p>Which method gets called here and why?</p>
