You are on page 1of 3

EXERCISE 1

Find the output ?


class A;
endclass
class B extends A;
function void print();
$display(Printing B );
endfunction
endclass
Module top;
initial begin
A a=new();B b=new(); a.print();
end
endmodule
SOLUTION
It gives error as the method is undefined in class A.

You might also like