×

class packet;
virtual function display();
$display(“inside the base class”);
endfunction
endclass
class small_packet extends packet;
function display();
$display(“inside the child class”);
endfunction
endclass

module tb;
packet p;
small_packet p1;
initial begin;

p1=new();
p=p1;
p1.display();
p.display();

end
endmodule

Leave a Reply

Your email address will not be published. Required fields are marked *

Author

akash.btechcs09@gmail.com

Related posts

In

We are dedicated to make our people and country as technical leader

Welcome to WordPress. This is your first post. Edit or delete it, then start writing!

Read out all