Skip to content

Instantly share code, notes, and snippets.

@hawksprite
Created March 20, 2017 23:19
Show Gist options
  • Save hawksprite/08556068a5515b76016e43a3e45c9e0d to your computer and use it in GitHub Desktop.
Save hawksprite/08556068a5515b76016e43a3e45c9e0d to your computer and use it in GitHub Desktop.
class ChloeDriver {
public static void main(String[] args) {
// Create our new linked list
AlphaList mainList = new AlphaList();
// Add three strings to it
mainList.addItemEnd("Apples");
mainList.addItemEnd("Orange");
mainList.addItemEnd("Pizza");
// Display it
mainList.printList();
// Now we're going to add cake to the begining
mainList.addItemBeginning("Cake");
// And remove Orange
mainList.removeAt(3);
// Display it
mainList.printList();
// Now we'll add something after Apples
mainList.addItem("Tissues", 3);
// Display it
mainList.printList();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment