Code -
class a;
int b;
endclass
module test();
initial
begin
a a_inst;
for (int i = 0; i < 10; i++)
begin
a_inst = new();
end
end
endmodule
Question -
Since the loop executes 10 times, it will create 10 objects. But the same handle is pointing to different instances on each iteration.
What happens to all 9 objects at the end of the loop?