(String item)
| 29 | } |
| 30 | |
| 31 | public void enqueue(String item) { |
| 32 | Node oldlast = last; |
| 33 | last = new Node(); |
| 34 | last.item = item; |
| 35 | last.next = null; |
| 36 | if (isEmpty()) |
| 37 | first = last; |
| 38 | else |
| 39 | oldlast.next = last; |
| 40 | n++; |
| 41 | } |
| 42 | |
| 43 | public String dequeue() { |
| 44 | if (isEmpty()) |