Created
March 20, 2017 23:19
-
-
Save hawksprite/08556068a5515b76016e43a3e45c9e0d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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