Tuesday, April 16, 2002 10:58 PM
Create a class Employee implementing Comparable with name, age, salary and a toString() method to print all of the values at once.
Create a new class EmployeeList with a TreeSet of employees and in its main method:
- Add each Employee to employees.
- Grab the employees iterator and print each of the employees.
Generally linked lists aren't used all that much in Java. If you wanted to link the nodes, you could put a nextEmployee field in Employee and link that to the next employee when you iterate through.