Skip to the selected question
ASIC.FYI

ASIC Question Bank

1,000+ hardware interview questions
DescriptionQ724
Q724DVDesignASIC interview problem

Virtual methods

TechniquesSystemVerilogObject-oriented dispatch
DifficultyEasy
TopicSV
LanguageSystemVerilog
Format4 choices
01

Problem

What is printed?

Class declarationSystemVerilog
class B;
  virtual function string kind(); return "B"; endfunction
endclass
class D extends B;
  function string kind(); return "D"; endfunction
endclass
B b; D d = new;
initial begin b = d; $display("%s", b.kind()); end
02

Answer choices (4)