This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
but when i tried to build it i wanted to copy that proccess so i pushed to st1 poped from st1 and then pushed into st2. didnt work at all
I think you misinterpreted your instructor's instructions. To add to the queue, you simpy push onto stack 1. To remove from the queue, you simply remove from stack 2. Only when stack 2 is empty, and you need to remove, do you pop from stack 1 and push to stack 2 -- and in that case, you must completely move everything from stack 1 to stack 2.
Regardless, show us your code. We can't figure out where it "didnt work at all" without an idea of what you are doing.
In fact I think the best way to get this done is execute the algorithm by hand, for example with a stack of index cards. Only when you got that working, that is you understand how the algorithm works, start coding it in Java.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus