I have a few classes.
Shift : Each shift contains a list of 6-12 employees
Employee : Just an object
Payroll : Creates 14 shifts
I need to pass the list from Shift to Payroll so I can add each Employee to a HashSet but I am a bit lost, as my methods don't seem to work. If someone could point me in the right direction or shoot some code my way it would be much appreciated.
What is it that isn't working as you expect? It's a bit much to plow through 200 lines of code to attempt to answer a vague question; something more specific would help us give you an answer to the question you really mean to ask.
As I was posting this, I was thinking to myself that I should have been more specific and sure enough! heh
I need the ArrayList shiftWorkers in class Shift to be sent out so that I could use it to create a new ArrayList in PayRoll. Currently I have a method that just returns the ArrayList shiftWorkers and then in payroll on line 50 I have a method that takes it and adds each entry into a new arraylist. It returned null and thus I commented it out.
Yes. In what way would you take an ArrayList<Employee> shiftEmployees in shift, and return it so you could then add it to ArrayList<Employee> acceptedFromReturns in PayRoll. I am unsure how I would go about creating methods like this. Like I said, it didn't work and it output null.
Your statement "it didn't work" doesn't tell me WHAT didn't work. If it "returned null", then supposedly there is a line of code you are talking about that you expected to return something and did not. I suppose I might be able to figure it out at this point, but experience tells me I have a good chance of guessing the wrong thing.
In general, I would expect some part of your code to have logic that is run when it is time to run payroll, let's call this code "Payday"; it isn't necessarily a class itself, although all code in Java is in some class.
I would expect that when the Payday code is run, it invokes a method that gives it one or more Shift objects for which it is going to generate a PayRoll for them. The way information gets from one object to another is through methods; either parameters are passed in the methods (usually for sending information into the other class) or objects or values are returned from methods (for getting them back).