DescriptionQ681
Q681DVDesignASIC interview problem
Shallow copying
TechniquesSystemVerilogObject-oriented dispatch
DifficultyEasy
TopicSV
LanguageSystemVerilog
Format4 choices
01
Problem
What value is printed?
Class declarationSystemVerilog
class Box; int v; endclass
class C; Box box; endclass
C a, b;
initial begin
a = new;
a.box = new;
a.box.v = 1;
b = new a;
b.box.v = 9;
$display("%0d", a.box.v);
end02
