Advertisement
Guest User

Untitled

a guest
Mar 6th, 2015
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.42 KB | None | 0 0
  1. public class LinkedList {
  2.     public int size = 0;
  3.     public Element first;
  4.     public Element last = null;
  5.  
  6.  
  7.     static class Element {
  8.         Element prev;
  9.         Element next;
  10.         Object value;
  11.  
  12.         Element (Object value) {
  13.             this.value = value;
  14.         }
  15.     }
  16.  
  17.     public void add (Object o) {
  18.         Element e = new Element(o);
  19.         first.value = e.value;
  20.  
  21.         size++;
  22.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement