How can we create a "Node" type fild in a Node class?
<p>Stack implementation.
How can we create a "Node" type fild in a Node class??
How can variable "first" of type "Node" contain fild of type "Node"?
Thank You for help</p>

<pre><code>public class Stack 
{
private Node first = null;

private class Node
{
    String item;
    Node next;
}

public boolean isEmpty()
{
    return first == null;
}

public void push(String item)
{
    Node oldFirst = first;
    first = new Node();
    first.item = item;
    first.next = oldFirst;  
}

public String pop()
{
    String item = first.item;
    first = first.next;
    return item;
}
</code></pre>

<p>}</p>
