Skip to content

Instantly share code, notes, and snippets.

@olupotd
Created December 5, 2013 16:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save olupotd/7809139 to your computer and use it in GitHub Desktop.
Save olupotd/7809139 to your computer and use it in GitHub Desktop.
Linked List
import java.util.*;
public class Listing {
LinkedList ll = new LinkedList();
Listing()
{
//adding an item to the list
l.add(3);
l.add(2);
//removing an item from the list
l.remove(2);
//going through the entire list
Iterator it = l.iterator();
while(it.hasNext())
{
System.out.println(it.next());
}
}
pubic static void main(String[] args)
{
try{
new Listing();
}catch(Exception except)
{
except.printStackTrace();
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment