-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathNode.java
41 lines (34 loc) · 978 Bytes
/
Node.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/************************************************************************
*** ***
*** Testing Version of the Node Class ***
*** (jacobo) ***
*** ***
************************************************************************/
public class Node
{
private String data;
private Node next;
public static int constructCount = 0; // To keep track of constructor calls
public Node(String initData, Node initNext)
{
data = initData;
next = initNext;
constructCount++; // For testing
}
public String getData()
{
return data;
}
public Node getNext()
{
return next;
}
public void setNext(Node newNext)
{
next = newNext;
}
public void setData(String newData)
{
data = newData;
}
}