write JAVA code with the following condition
Write the pseudocode for a new data type MyStack that implementsa stack using the fact that you have access to a queue datastructure with operations enqueue(), dequeue(), isEmpty(). Rememberthat every stack should have the operations push() and pop().
Hint: use two queues, one of which is the main one and one istemporary. Please note that you won’t be able to implement bothpush() and pop() in constant time. One of the two will have to runin O(n), where n is the number of elements in the stack.