views:

81

answers:

1

I'm trying to create a reference based linked list anyone would be able to provide me an example of it??

+2  A: 

This isn't an answer as such but the following domain class should get you started:

public class Element{

private Object objectLink;

private Element nextElement;
private Element previousElement;

// Getter and setter methods here

}

What you need to add to this is a class that allows adding, removal and checking the state of the list (empty, size, etc.).

James P.
I've created a linked list with this.public LinkedList<String> list = new LinkedList<String>();Does it still require heads or iterator sort of things in order to create a linked list??
Max
Well, it depends on whether you are required to implement the full List interface http://java.sun.com/j2se/1.4.2/docs/api/java/util/List.html or if what is asked is to create something that fits this description http://en.wikipedia.org/wiki/Linked_list
James P.