Question: In Java Write a program to create Stack that can take input random candies color (i.e. yellow, green, orange, red etc) and stored in order.
In Java Write a program to create Stack that can take input random candies color (i.e. yellow, green, orange, red etc) and stored in order. The user likes any one of the colored candy to eat so he takes out all the candies, one by one, eats only the chosen color and keeps other in order so that he can return them to stack in exactly the same order as before minus the chosen candies. Print both the input and resultant stack.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
