title: Which OO concept is "Base b = new Derived()" an example of?
body: <p>I was passing a test and met a question in which we didn't find an agreement with my colleagues.</p>
  
  <p><strong>С++</strong></p>
  
  <pre><code>  1 class Base {};
    2 class Derived : public Base {};
    3 class Foo
    4 {
    5 public:
    6     Foo()
    7     {
   -8-         Base* b = new Derived(); // Concept name is?
    9     }
   10 };
  </code></pre>
  
  <p><strong>C#</strong></p>
  
  <pre><code>  1 abstract class Base{}
    2 public class Derived : Base{}
    3
    4 public class Foo
    5 {
    6    public Foo
    7    {
   -8-        Base b = new Derived(); // Concept name is?
    9    }
   10 }
  </code></pre>
  
  <p>The question is: line number 8 above is an example of the following oo concept</p>
  
  <ol>
  <li>Polymorphism</li>
  <li>Aggregation</li>
  <li>Encapsulation</li>
  <li>Abstraction</li>
  <li>Inheritance</li>
  </ol>
  
  <p>Please put a link with the answer to the source of knowledge.</p>
  
  <p>P.S. The test is 'OO Concept' on breinbench. It is free.</p>
  
  <p><strong>Update:<br></strong></p>
  
  <p>From one of the answer which defends <strong>polymorphism</strong></p>
  
  <blockquote>
    <p>"In simple terms, polymorphism is the
    ability of one type, A, to appear as
    and be used like another type, B. In
    strongly typed languages, this usually
    means that type A somehow derives from
    type B, or type A implements an
    interface that represents type B."</p>
  </blockquote>
  
  <p>From wikipedia which defends <strong>inheritance</strong></p>
  
  <blockquote>
    <p>Inheritance is also sometimes called
    generalization, because the <strong>is-a</strong>
    relationships represent a hierarchy
    between classes of objects.</p>
  </blockquote>
  
  <p>and </p>
  
  <blockquote>
    <p>Inheritance therefore has another
    view, a dual, called polymorphism,
    which describes many pieces of code
    being controlled by shared control
    code.</p>
  </blockquote>
  
  <p>so <code>Base = new Derived()</code> shows 'is a'(<strong>inheritance</strong>). And consequence of this is <strong>polymorphism</strong>.</p>
  
  <p>So I doubt what is right?</p>