Every time you call a method, Java pushes a new frame onto the call stack. That frame holds the method's parameters and local variables. When the method returns, its frame is popped off the stack.
main() calls greet()
greet() calls format()
format() returns
greet() returns
main() continues
The call stack is why local variables inside one method cannot be seen by another. Each frame is isolated. If greet declares int x = 5, the format method has no access to that x.
What happens if a method calls itself? That is recursion, and you'll explore it later. Each recursive call adds another frame. If the recursion never stops, the stack runs out of memory and you get a StackOverflowError.