Connecting Tech Pros Worldwide Help | Site Map

String - not shallow copy

Member
 
Join Date: Nov 2007
Posts: 125
#1: Sep 27 '08
hello,

i wonder why the String class does not perform a shallow copy? is there something that makes it different? how to make a class similar to the string class.


thanks in advance
kenobewan's Avatar
Moderator
 
Join Date: Dec 2006
Posts: 4,745
#2: Sep 27 '08

re: String - not shallow copy


I'm not sure what the problem with your application is. Are you getting an error?
Member
 
Join Date: Nov 2007
Posts: 125
#3: Sep 28 '08

re: String - not shallow copy


hi,

thank you for the reply.

no, i don't get any error. i'm just curious why string objects do deep copy, while others do shallow. is it because string class is declared using the 'immutable' keyword?

i want to know,
how to deep copy objects?

thanks
Reply