How can I copy a transaction class object containing associative array members to another object of the same class?

In reply to Laya V V:

I have here a very simple example outside UVM.
It shows how it works.
module top;
class A;
int a;
string b [string];

function new();
    a = 5;
b = '{"Christoph":"Suehnel", "Germany":"Bavaria"};
endfunction

endclass

class B extends A;
int c;
string d [string];

 function new();
   super.new();
   c= 7;
 endfunction

endclass

initial begin
A a_inst;
B b_inst;

a_inst = new();
$display("a_inst::a = %d", a_inst.a);
$display("a_inst::b = %p", a_inst.b);

b_inst = new();
b_inst.d = a_inst.b;
$display("b_inst::c = %d", b_inst.c);
$display("b_inst::d = %p", b_inst.d);

end
endmodule