Self-Test Questions


Suggested Projects

  1. Employee Management Program:   Using the Person class, Payable interface and Employee, HourlyEmployee, and SalariedEmployee classes originally presented in chapter 11 write a GUI-based employee management program that lets users create and pay employees. Maintain employee objects in a collection. If you use Java 5 maintain employee objects in a generic collection whose elements are of type Employee.

  2. Implement The Comparator Interface:   Background — Objects inserted into an ordered collection must implement the java.lang.Comparable or the java.util.Comparator interface. The Comparable interface is used to order objects according to their natural ordering. (For example, Integers have a natural ordering.) The Comparator interface is used when objects do not have a natural ordering as defined by Comparable or when you want to order them differently from their natural ordering. Task — Modify the Person class to implement the Comparator interface. Have it compare Person objects according to their age. Write a program that creates several different Person objects and insert them into an ordered collection in unsorted order. Print the contents of the collection to the console.

  3. Aircraft Engine Simulation Revisited:   Return to chapter 11 and reexamine the aircraft engine simulation code. In its current form, the Part class contains and manages a HashTable of subparts. Upgrade the simulation to utilize a Java 5 generic Hashtable.




Java For Artists(c) The Art, Philosophy, and Science of Object-Oriented Programming
Java For Artists: The Art, Philosophy, And Science Of Object-Oriented Programming
ISBN: 1932504052
EAN: 2147483647
Year: 2007
Pages: 452

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net