/* * File: MethodCalls.java * Author: Java, Java, Java * Description: This program illustrates the flow of control * that results when methods are called. */ public class MethodCalls { public void method1(String s) { System.out.println(s); // 2, 4 } public String method2() { return "hello"; // 6 } public static void main(String args[]) { MethodCalls obj = new MethodCalls(); obj.method1("hello"); // 1 obj.method1("goodbye"); // 3 System.out.println(obj.method2() + " friend"); // 5 } // main() } // MethodCalls