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).
Is that any help?
rc