ariestamirra

tostr

Nov 20th, 2014
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.38 KB | None | 0 0
  1.     public static <T> String toString(Node<T> front) {
  2.         if (front == null) {
  3.             return "null";
  4.         }
  5.         Node<T> curr = front;
  6.         java.lang.String str = "[ " + curr.nodeValue;
  7.         while (curr.next != null) {
  8.             curr = curr.next;
  9.             str += "," + curr.nodeValue;
  10.         }
  11.         str += " ]";
  12.         return str;
  13.     }
Advertisement
Add Comment
Please, Sign In to add comment