This repository has been archived on 2020-05-27. You can view files and clone it, but cannot push or open issues/pull-requests.
jlinkedlist/Node.java

31 lines
458 B
Java
Executable File

public class Node {
private Object item;
private Node next;
public Node (Object item) {
this.item = item;
next = null;
}
public Node (Object item, Node next) {
this.item = item;
this.next = next;
}
public void setItem (Object item) {
this.item = item;
}
public void setNext (Node next) {
this.next = next;
}
public Object getItem () {
return item;
}
public Node getNext () {
return next;
}
}