Re: what does <return 0> signifies?

You can use any other value. I don't have all the details of why 0 is used, however; I believe it has to do with being used as a flag indicating failure (some languages -- like c++ use 0 for false, and >0 for true). In the case you have used it you will run into problems. If you have 0 items in a stack and someone attempts to pop the value it should cause an error, since an empty stack can't return anything -- it's empty. Currently it will return 0 when it is empty.

Java Code:

Stack st - new Stack();
int element = st.pop();

This will print that a stack underflow has occurred, but will still be allowed to continue. Which can naturally be problematic. If you have some program with automates over a stack you can cause a problem. The underflow occurs but the automation won't be aware. Instead of printing the error message, I'd suggest you throw an exception.

Now we can see the return value as 3 in the last line as the output as we have used return 3, or for any matter it shows the value we are using with return.
Still I am unable to understand the purpose of return.