Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args)
- {
- System.out.println("main() start");
- // Call another method, pushing it onto the top of the call stack:
- doWork();
- System.out.println("main() end");
- }
- public static void doWork()
- {
- // doWork begins execution:
- System.out.println("doWork() start");
- // do stuff.
- System.out.println("doWork() end");
- // doWork ends execution, and is popped from the top of the stack.
- // The next item in the stack, main() is now at the top of the stack.
- // It is also the only item in the stack.
- }
Add Comment
Please, Sign In to add comment