Understanding handle copy in systemverilog

Dear All,

I’m trying to understand about copying handle of systemverilog and referring the below code.

class parent_class;
  bit [31:0] addr;
  
  function display();
    $display("Addr = %0d",addr);
  endfunction
endclass

class child_class extends parent_class;
  bit [31:0] data;
  
  function display();
    super.display();
    $display("Data = %0d",data);
  endfunction
endclass

module inheritence;
  initial begin
    parent_class p=new();
    child_class  c=new();
    c.addr = 10;
    c.data = 20;
    p = c;        //assigning child class handle to parent class handle
    c.display(); 
  end
endmodule

and I can get the below values.

ncelab: *W,DSEMEL: This SystemVerilog design will be simulated as per IEEE 1800-2009 SystemVerilog simulation semantics. Use -disable_sem2009 option for turning off SV 2009 simulation semantics.
Loading snapshot worklib.inheritence:sv .................... Done
ncsim: *W,DSEM2009: This SystemVerilog design is simulated as per IEEE 1800-2009 SystemVerilog simulation semantics. Use -disable_sem2009 option for turning off SV 2009 simulation semantics.
ncsim> source /incisiv/15.20/tools/inca/files/ncsimrc
ncsim> run
Addr = 10
Data = 20

But I can’t understand how does c handle can have ‘Addr’ value?
and c class has only display function about data, but how does it display ‘Addr’?

In reply to UVM_LOVE:

When you call child_class::display(), it calls super.display() which resolves to parent_class::display(). The child_class type contains both data and addr variables.

Also, please see Misnomer in the term "child class" | Verification Academy

That is the beauty of object orient programming { POLYMORPHISM }. In this by just calling c.display() , you are getting 2 outputs .
now in this since child class is extended from parent class , so you can access the variables of parent class using the handle of child class , so c.addr = 10; assigns the value 10 to addr .
moreover you have used super keyword which means you refer to parent class , and you are overriding the display function in child class , which means that you are adding some extra features in your display function i.e. one more display statement .