class A;
function int display();
int i=10;
return(i);
endfunction
endclass
module check();
A a;
int x;
initial begin
x=a.display();
$display("x=%0d", x);
end
endmodule
In the above code, I didnt create any object for class A, with the help of handle I have called the function display() and its returning i value to x(i = 10). My question is how the memory will be allocated for ‘i’ without new() construct or is it just printing i value? Please justify and correct me if I am wrong.