the o/p of following program is:
queue Q=new queue();
stack S=new stack();
s.push(new interger(8));
s.push(new interger(9));
s.push(new interger(10));
q.enqueue(s.pop());
q.enqueue(new interger(8));
q.enqueue(new intergr(9));
s.push(q.dequeue());
system.out.print(s.pop());
system.out.print(s.pop());
a.10,8,9
b.8,9,10
c.9,8,10
d.10,9,8
my doubt is pf statemnt is 2 so why ans is giving in 3 val??
plx explain last 3 lines.i think in stack the element are 10,9,8 in pop out order(order in which they r pop out)
so ans is D???