Question: Modify above by adding new class Element which has an integer variable that store the data. Make any needed changes to add, transfer and print
Modify above by adding new class "Element" which has an integer variable that store the data. Make any needed changes to add, transfer and print the object from the stack or the queue.
Using Stack and Queue build-in JAVA classes to implement the following: At the main create new object of the stack class and Queue class Add four elements to the stack Print all stack and queue elements Send the stack and the queue to another method "transfer" Create "transfer" method which takes two arguments (Stack, Queue) o this methods with transfer all element form the stack to the queue one at a time print all stack and queue elements
Step by Step Solution
3.39 Rating (152 Votes )
There are 3 Steps involved in it
2 import javaio import javautil class Elements I nteger data ElementsInteger a dataa Override p... View full answer
Get step-by-step solutions from verified subject matter experts
