# Object coping

**URL:** <https://verificationacademy.com/forums/t/object-coping/34171>\
**Category:** SystemVerilog\
**Tags:** SystemVerilog\
**Created:** [March 9, 2018, 3:21am UTC](https://verificationacademy.com/forums/t/object-coping/34171 "2018-03-09T03:21:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![HimanshuPatra](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/h/bbce88/32.png) [@HimanshuPatra](https://verificationacademy.com/forums/u/HimanshuPatra)\
**Post date:** [March 9, 2018, 3:21am UTC](https://verificationacademy.com/forums/t/object-coping/34171/1 "2018-03-09T03:21:57Z")

</div>

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;

---

<div class="post-metadata">

**Author:** ![dave\_59](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/dave_59/32/4499_2.png) [@dave\_59](https://verificationacademy.com/forums/u/dave_59)\
**Post date:** [March 9, 2018, 3:42am UTC](https://verificationacademy.com/forums/t/object-coping/34171/2 "2018-03-09T03:42:32Z")

</div>

_In reply to [Himanshu Patra](https://verificationacademy.com/forums/t/object-coping/34171):_

Please see my course on [SystemVerilog OOP](https://verificationacademy.com/topics/systemverilog/systemverilog-oop-for-uvm-verification/).
