Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. public class List
  2. {
  3. public Node head;
  4. protected Node ptr;
  5.  
  6. public List()
  7. {
  8. head = null;
  9. ptr = head;
  10. }
  11.  
  12. public List addNext(String data)
  13. {
  14. Node newn = new Node(data);
  15. ptr.next = newn;
  16. ptr = newn;
  17.  
  18. return this;
  19. }
  20.  
  21. public List addList(List list)
  22. {
  23. ptr.next = list.head;
  24. ptr = list.ptr;
  25.  
  26. return this;
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement