A stack obeys the "first in, last out" principle. In Java, the StackTrace rule says: Remember that the last function called is the first function to end. That is, if function A calls function B, which calls function C, which calls function D, then returning from function B requires that we first return from function C, which requires that we first return from function D.