Question on Inheritance in SV

In reply to dave_59:
Hi Dave, could you please clarify the following. in the following code from above example, are d1 ,d2 and d3 get created and assigned with default value of 0 before super.new(d3) , and assigned with the values d1=4, d2=c2 and d3=6 immediately after super.new(d3) in the D class constructor.


class D extends C;
   int d1 = 4;
   int d2 = c2;
   int d3 = 6;
function new;
   super.new(d3);
endfunction
endclass


I am expecting that way as I am getting the value of d3 as 6 in the below code. could you please clarify.



module top;
class C;                                                 
   int c1 = 1;
   int c2 = 1;
   int c3 = 1;
function new(int a);
   $display("ZAM: a_val: %d",a); // always getting display as 0
   c2 = 2;
   c3 = a;
endfunction
endclass
 
class D extends C;
   int d1 = 4;
   int d2 = c2;
   int d3 = 6;
function new;
   super.new(d3);
   $display("value of d3 %d",d3);
endfunction
endclass
 
 
D d1=new();
initial  begin
end
endmodule