Node - this.next = next; } public int getData(){ return...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
public class Node{ private int data; private Node next; //default constructor public Node(){ data = 0; next = null; } public Node(int data, Node next){ this.data = data; this.next = next; } //getter public Node getNext(){ return next; } //setter public void setNext(Node next){
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: this.next = next; } public int getData(){ return data; } public void setData(int data){ this.data = data; } public String toString(){ String ret = "Data: " + data + "\n"; return ret; } }...
View Full Document

This note was uploaded on 01/30/2010 for the course CS 1316 taught by Professor Staff during the Spring '08 term at Georgia Tech.

Ask a homework question - tutors are online