permaculture playing cards*
The moose likes Beginning Java and the fly likes Circular List Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Circular List" Watch "Circular List" New topic
Author

Circular List

Ronald Spina
Greenhorn

Joined: Jan 23, 2012
Posts: 26
Good afternoon,

I'm working on a program in which I am trying to implement a circular list. Till now I have a MainProgram where I invoke method from the Method class in which I prompt the user to enter details and return this as an object. Then I have created my circular list with methods append and show. I'm appending the object to my circular list and then i will invoke method ListAll() to show all the members of the list.

The problems I have is that i am not sure if the circular list is beign populated... and none members are beiggn shown. I know I surely have some mistakes in CircularList class but i'm stuck and cannot identify my mistakes.

Below follows my code. Thanks

import java.util.*;



import java.util.*;




Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18509
    
  40


Take out a pencil and paper, and walk through what your append method is doing. You will see that it doesn't do it correctly.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Ronald Spina
Greenhorn

Joined: Jan 23, 2012
Posts: 26
Thanks henry .. i have revised method append and adjusted as follows

However it is still not working.
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18509
    
  40

Ronald Spina wrote:Thanks henry .. i have revised method append and adjusted as follows

However it is still not working.


Go back to pen and paper (and walk through the methiod) again. You will see why.

Henry
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Circular List
 
Similar Threads
Modify a Linked Linear list into a Circular List.
readObject from Stream till EOF
Append objects to List and show them.
Node Search
Append writeObject()