Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class List
- {
- public Node head;
- protected Node ptr;
- public List()
- {
- head = null;
- ptr = head;
- }
- public List addNext(String data)
- {
- Node newn = new Node(data);
- ptr.next = newn;
- ptr = newn;
- return this;
- }
- public List addList(List list)
- {
- ptr.next = list.head;
- ptr = list.ptr;
- return this;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement