Thread View: aus.computers.java
1 messages
1 total messages
Started by Ogi
Sun, 12 Nov 2000 00:00
Stack 'deep copy'
Author: Ogi
Date: Sun, 12 Nov 2000 00:00
Date: Sun, 12 Nov 2000 00:00
17 lines
1269 bytes
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
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads