Assume the declaration of array weekName String weekName S
Assume the declaration of array weekName.
 String weekName[ ] = {\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"};
 Assume that the a glassqueue q1 contains the elements of weekName and a array stack stk1 contains the elements of the same array weekName.
GlassQueue<String> q1=new GlassQueue<String>();
 ArrayStack<String> stk1=new ArrayStack<String>();
 String weekName[ ] = {\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"};
 String strB = (String)stk1.top();
 String strA = (String)q1.peekFront();
 while(strA != strB){
 stk1.pop();
 q1.dequeue();
 strB=(String)stk1.top();
 strA=(String)q1.peekFront();
 }
 System.out.println(\"strA= \" + strA);
After executing the loop, strA contains the following day :
Solution
The Above Question Answer is Sunday.Because in the Datastructure have PUSH() and POP() Operations.In this question you are asking output by using System.out.println.So POP() method read the list TOP to Bottom.
![Assume the declaration of array weekName. String weekName[ ] = {\ Assume the declaration of array weekName. String weekName[ ] = {\](/WebImages/38/assume-the-declaration-of-array-weekname-string-weekname-s-1114159-1761591441-0.webp)
