Object coping

  1. What is the difference between this two statements:

a. Packet Pkt1_h, Pkt2_h; //two objects of class “Packet”
begin
Pkt1_h = new();
Pkt2_h = Pkt1_h; //Coping the handle, reffering to same object. (Before constructing the second object do you need to copy.
//what is the difference between this two-line

  • Pkt2_h = new() Pkt1_h;

  • Pkt2_h = new();

  • Pkt2_h = Pkt1_h;

In reply to Himanshu Patra:

Please see my course on SystemVerilog OOP.