Methods, control flow
We started the day with a quick warm-up exercise. We’ll often do this to make sure we’re all on the same page and get an opportunity to clear up any confusion.
Today’s topic was methods. I explained that methods are used to group together related statements and reduce redundancy. A method definition looks like this:
public static void () {
}
Just writing a method doesn’t do anything, though. We learned that Java programs are always run from the top of the main method down. So if a method is never called, it is never executed.
We used the jGRASP debugger to see control flow (the order in which statements are executed) in action. We discovered that computers have something called a call stack to keep track of which code is running currently and what will be run next. You can read more on the Wikipedia article on the topic.




