Kindly make use of the Code Tags whenever you paste your java code so that it looks neatly.
Conceptually, "popping an element from a stack" involves
Getting an element from the TOS (Top of the Stack)
Adjust the TOS accordingly (here, you decrease it by one).
If you do it the otherway, you will NOT get the *actual element* in the TOS rather the one which is next to TOS.
The problem why you get code is not reachable is, you have a return statement prior to decrementing sp by 1. Once the control reaches a "return" statement, all the other following statements will NOT get executed.
Put the return statement as the last statement in the method! It should work