Guest User

Untitled

a guest
Apr 25th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.44 KB | None | 0 0
  1. public class Node<T>
  2. {
  3.     public T data;
  4.     public Node<T> next;
  5.    
  6.     public Node()
  7.     {
  8.         data = null;
  9.         next = null;
  10.     }
  11.    
  12.     public Node(T data)
  13.     {
  14.         this.data = data;
  15.         this.next = null;
  16.     }
  17.    
  18.     public Node(T data, Node<T> next)
  19.     {
  20.         this.data = data;
  21.         this.next = next;
  22.     }
  23.    
  24.    public String toString()
  25.    {
  26.        return data.toString();
  27.     }
  28.  
  29. }
Add Comment
Please, Sign In to add comment