Skip to content

Instantly share code, notes, and snippets.

@joa
Last active December 22, 2015 11:08
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 joa/6463072 to your computer and use it in GitHub Desktop.
Save joa/6463072 to your computer and use it in GitHub Desktop.
package;
public final class Madness {
public static void main(final String[] args) {
final Stack<Integer> stack = new Stack<>();
stack.add(1);
stack.add(2);
stack.add(3);
stack.push(4);
System.out.println("stack:");
for(final int i : stack) {
System.out.println(i);
}
final LinkedList<Integer> list = new LinkedList<>();
list.add(1);
list.add(2);
list.add(3);
list.push(4);
System.out.println("list:");
for(final int i : list) {
System.out.println(i);
}
}
}
/*
stack:
1
2
3
4
list:
4
1
2
3
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment