This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
Please check Line 66. You initialized your 2nd stack of size 8. You pushed 8 numbers in it and when its time to pop them you are running loop from 0 to 5. Change your loop condition for second stack output and you should have desired output.