In reply to chr_sue:
I meant same class for the agents as described in the following example :
apb_agent_c apb_tx;
apb_agent_c apb_rx;
virtual task build_phase(uvm_phase phase);
apb_tx = apb_agent_c::type_id::create("apb_tx", this);
apb_rx = apb_agent_c::type_id::create("apb_rx", this);
endtask: build_phase