ok, what you need to do, is to split them up. keep the main method in Payrollprogram and then everything to do with the details of a client, you keep in a different class.
to then access the clients, you'll do exactly the same thing as you were doing. i'm assuming you havn't done packages yet, so don't worry about that.
you'll probably end up with a class that runs the program, a class that creates a client and then maybe a class that works out the client's pay and so on.
splitting them up makes it easier to find find the problem when something isn't working.
Easter Bunny
Junior Poster in Training
57 posts since Jun 2005
Reputation Points: 10
Solved Threads: 1
No, it would go in an Employee class, which would contain all of the data pertaining to a particular employee.
The payroll program works with employees, but is not itself an employee. Class design is an exercise in separation of responsibilities.
Ezzaral
Posting Genius
15,986 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847
Well, go through each of those methods and ask yourself, "Does this data or action apply to one and exactly one particular employee?". If it does, it goes there. If it doesn't then it goes in some other class that manages that particular functionality.
Ezzaral
Posting Genius
15,986 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847
No, each employee is it's own instance. The class is just a template for that instance. All Employee objects would have the same property fields, but the values of those properties are different for each employee.
Ezzaral
Posting Genius
15,986 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847
Ezzaral
Posting Genius
15,986 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847
anyone please tell me how to find Krishnamurti number in java??
Start a new thread and what is a Krishnamurti number? Do you know and you just want the java code? If not try searching the net for the definition of Krishnamurti number
javaAddict
Nearly a Senior Poster
3,329 posts since Dec 2007
Reputation Points: 1,014
Solved Threads: 448