How Implementations can be replaced at run-time for object composition(interface inheritance)
<p>I have came across the following point <code>the advantage of object composition over class inheritance</code>. But I often see the following sentence in many articles</p>

<blockquote>
  <blockquote>
    <p>In object composition, functionality is acquired dynamically at run-time by objects collecting references to other
    objects. The advantage of this approach is that implementations can be replaced at run-time. This is possible because
    objects are accessed only through their interfaces, so one object can be replaced with another just as long as they
    have the same type.</p>
  </blockquote>
</blockquote>

<p>But doubt may be naive, since i am a beginner. How the implementation can be replaced in runtime? If we write a new line of code, don't we need to compile to reflect the change? Then what is meant be <code>replacing at runtime</code>? quite confusing.
Or any other magic, behind the scene activities happen. Can anyone please reply.</p>
