import java.util.LinkedList; public class LinkedListStack { public static void main(String[] args) { myStack stack = new myStack(); for (int i = 0; i < 10; i++){ stack.push(i); } System.out.println(stack.top()); System.out.println(stack.top()); } } c…