((Application)application()).addGuest(currentGuest); currentGuest = new Guest();
This code calls the application's addGuest method, which adds an object (in this case, currentGuest) to the end of the array. Then it creates a new Guest object to hold the next guest's data.
Note: The addGuest method is defined in the class Application, which is a subclass of WebApplication. The component's application method (called in the above statement) returns an object of type WebApplication, so you must cast it to Application in order to access its addGuest method.
Table of Contents Next Section