title: What will happen if we assign child handle to parent handle and the result in case of accessing parent handle?
body: <p>Problem statement: there are 2 classes (parent and child class). Both have same <code>display</code> function in it. I have assigned child class handle to parent class handle by &quot;<code>p=c;</code>&quot; after that, I was trying to access <code>p.display()</code>, but in my understanding it should use function from child class. But, after run, I see it is printing from parent class. Any clue why?</p>
  <pre><code>class parent;
    function void display();
      $display(&quot;I am in parent&quot;);
    endfunction
  endclass
  
  class child extends parent;
    function void display();
      $display(&quot;I am in child&quot;);
    endfunction
  endclass
  
  module tb;
    parent p;
    child c;
  
    initial begin
      p = new();
      c = new();
      $display(&quot;1: %d    %d&quot;, p , c);
      p = c ;
      $display(&quot;%d    %d&quot;, p , c);
      p.display();
  
    end
  
  endmodule
  </code></pre>