Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vector cloning

Status
Not open for further replies.

TomArrow

Programmer
Aug 2, 2001
5
US
i have a vector holding objects. i want to clone it. if the vector is called v can i say:
Code:
Vector newVector = (Vector)v.clone();
?
will this be a complete new copy without any reference to the old one? if i make changes to v do i see those changes in newVector?

thankyou
 
It should be a completely new instance, in a completely new memory location. This is what makes the clone method so expensive.

Also see my response in the Servlets forum. Wushutwist
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top