/* 10/7/2019 * 1. Demonstrated 2 methods, and showed how the system STACK * keeps track of method calls and returns. * * 2. We showed how a method call can appear inside a LOOP. */ public class HelloWorld { public static void main(String[] args) { // method call transfers control to the method for (int i=0; i<5; i++) { printHello(); } System.out.println("main is returning"); } /** method printHello displays Hello World! to the screen * it has no parameters and returns void */ public static void printHello() { System.out.println("Hello World!"); printGoodbye(); System.out.println("finished method printHello, returning"); } /** method printGoodBye displays Good bye! to the screen * it has no parameters and returns void */ public static void printGoodbye() { System.out.println("Good bye!"); } }