🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: aus.computers.java
Article #347

Stack 'deep copy'

#347
From: Ogi
Date: Sun, 12 Nov 2000 00:00
17 lines
1269 bytes
Hi everyone,

I'm puzzled by this problem that i've been having, so any help would be much
appreciated!

Supposed i have a code or a stack ( or any ADT, i just use stack here as an
example ), and i want to do a deep copy of the objects that it contains, how
would u do that ? Suppose that the ADT has an iterator() method that returns
the iterator of the objects.

I tried retrieving each object and clone each of them, and then add ( or
'push' it in this case) it to the new Stack, but it didn't work, coz i just
realize that clone() in Object Class is a protected method.

thanks in advance!

ogi
Technical Details
Message-ID: <3a0e923b$0$19429$7f31c96c@news01.syd.optusnet.com.au>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 113ae9,d692be425b7943,start
X-Google-Attributes: gid113ae9,public
X-Google-Thread: 10d6db,d692be425b7943,start
X-Google-Attributes: gid10d6db,public
From: "Ogi" <_ojay_@nospam.excite.com>
Subject: Stack 'deep copy'
Date: 2000/11/12
Message-ID: <3a0e923b$0$19429$7f31c96c@news01.syd.optusnet.com.au>
X-Deja-AN: 692683054
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
X-Trace: 974033468 news01.syd.optusnet.com.au 19429 198.142.110.239
X-MSMail-Priority: Normal
Reply-To: "Ogi" <_ojay_@nospam.excite.com>
Newsgroups: aus.computers.java,comp.lang.java.help