aspose file tools*
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
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: 18675
    
    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: 39436
    
  28
. . . and welcome to the Ranch
 
 
subject: Employee Class problem