Prentice Hall and Sun Microsystems. Personal use only; do not redistribute.
15.2 Example: An On Line Travel Agent
373
Listing 15.6 TravelData.java (continued)
  private static HotelInfo[] janeHotelData =
   { new HotelInfo("Marriot", "MAR 666B"),
     new HotelInfo("Holiday Inn", "HI 228 555") };
  private static FrequentFlyerInfo[] joeFrequentFlyerData =
    { new FrequentFlyerInfo("Java Airways", "321 9299 J"),
      new FrequentFlyerInfo("United", "442 2212 U"),
      new FrequentFlyerInfo("Southwest", "1A345") };
  private static RentalCarInfo[] joeRentalCarData =
    { new RentalCarInfo("National", "NAT00067822") };
  private static HotelInfo[] joeHotelData =
   { new HotelInfo("Red Roof Inn", "RRI PREF 236B"),
     new HotelInfo("Ritz Carlton", "AA0012") };
  private static TravelCustomer[] travelData =
    { new TravelCustomer("jane@somehost.com",
                         "tarzan52",
                         "Jane",
                         "Programmer",
                         "Visa",
                         "1111 2222 3333 6755",
                         "(123) 555 1212",
                         "6 Cherry Tree Lane\n" +
                           "Sometown, CA 22118",
                         janeFrequentFlyerData,
                         janeRentalCarData,
                         janeHotelData),
      new TravelCustomer("joe@somehost.com",
                         "qWeRtY",
                         "Joe",
                         "Hacker",
                         "JavaSmartCard",
                         "000 1111 2222 3120",
                         "(999) 555 1212",
                         "55 25th St., Apt 2J\n" +
                           "New York, NY 12345",
                         joeFrequentFlyerData,
                         joeRentalCarData,
                         joeHotelData)
    };
  public static TravelCustomer[] getTravelData() {
    return(travelData);
  }
}
Second edition of this book: www.coreservlets.com; Sequel: www.moreservlets.com.
Servlet and JSP training courses by book's author: courses.coreservlets.com.






footer




 

 

 

 

 Home | About Us | Network | Services | Support | FAQ | Control Panel | Order Online | Sitemap | Contact

jsp web hosting

 

Our partners: PHP: Hypertext Preprocessor Best Web Hosting Java Web Hosting Jsp Web Hosting Cheapest Web Hosting

Visionwebhosting.net Business web hosting division of Web Design Plus. All rights reserved