I didnt make my statement clear enuf
所在版块:技术の宅 发贴时间:2006-04-09 15:52

用户信息
复制本帖HTML代码
高亮: 今天贴 X 昨天贴 X 前天贴 X 
in this case, a shallow clone will make an extra copy of Vector object. ( only container object is copied)

however, a deep clone will create memory for Vector object and all String objects inside this Vector. ( container and contained objects are all duplicated)

.
欢迎来到华新中文网,踊跃发帖是支持我们的最好方法!

Put your OWN COOL signature here!
 相关帖子 我要回复↙ ↗回到正文
[java] how to cast after clone()? 蚂蚁   (317 bytes , 901reads )
1.5的东东比1.4变了好多,搞的连java也不会写了^_^ 门中木   (0 bytes , 196reads )
try Vector<String> b = new Vector<String>(a); 绿竹幽径   (51 bytes , 404reads )
有一点点不一样 吴永铮   (134 bytes , 267reads )
能解释一下deep clone and shallow clone 么? icky   (0 bytes , 223reads )
Shallow clone 抽烟看球   (97 bytes , 224reads )
is it similar to copy pointer and copy objects in C? icky   (0 bytes , 241reads )
I didnt make my statement clear enuf 抽烟看球   (266 bytes , 224reads )
so shallow is just assign a reference , am I right 门中木   (0 bytes , 280reads )
copy object for container, copy referrence for contained object 抽烟看球   (0 bytes , 201reads )
我试了,第三个可以啊 吴永铮   (470 bytes , 307reads )
多谢!第三个是可以,不过 蚂蚁   (84 bytes , 262reads )
Leave it 抽烟看球   (212 bytes , 243reads )
总是觉得compile之后还有一行字,看起来实在是很不爽! 蚂蚁   (0 bytes , 251reads )
what is Vector<A> for? 逃课专家   (9 bytes , 254reads )
就是说这个vector里面放的都是A这个class的object 蚂蚁   (0 bytes , 303reads )