public class ShowNesting { // This application shows a simple example of a nested // method call. The only output should be the string: // Sorry. The manager is out to lunch. public static void main(String[] arguments) { CustomerManager myCustomer = new CustomerManager(); myCustomer.cancelAllOrders().talkToManager(); } } class CustomerManager { OrderManager cancelAllOrders() { OrderManager om = new OrderManager(); return om; } } class OrderManager { void talkToManager() { System.out.println("Sorry. The manager is out to lunch."); } }