jQuery in Action, 2nd edition*
The moose likes Beginning Java and the fly likes Employee Class problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Employee Class problem" Watch "Employee Class problem" New topic
Author

Employee Class problem

amruta shah
Greenhorn

Joined: Apr 10, 2012
Posts: 2
Create an employee class with the following properties:ID (int), FName(string), LName(string).
(Functionality) to track an employee's manager and subordinates.
Add a method that displays the names of all subordinates for a given employee.
Do not use multiple classes.(Use Tree Traversal)
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Hi Amruta, welcome to the Ranch!

It looks like you could benefit from reading quite a few of the sections of our HowToAskQuestionsOnJavaRanch FAQ. So please do that (follow the link) and then come back and post a question.
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

amruta shah wrote:Do not use multiple classes.(Use Tree Traversal)

Tree Traversal? means? .. can you elaborate...sorting is needed?
amruta shah
Greenhorn

Joined: Apr 10, 2012
Posts: 2
Seetharaman Venkatasamy wrote:
amruta shah wrote:Do not use multiple classes.(Use Tree Traversal)

Tree Traversal? means? .. can you elaborate...sorting is needed?


It means maintain a list of managers and employees who report to that manager and when input is the manager name display the list of all the employees who report to that manager.
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

then create a Manager class which has a List of Employee
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38100
    
  22
. . . and welcome to the Ranch
 
wood burning stoves
 
subject: Employee Class problem
 
Similar Threads
Comparable and Comparator
Collection
storing data
Store Data in Tree Node