I started Java recently and been learning about sets. I thought I understood the basics of sets, but I do not think I do
It is for an assignment which is why I don't want people to just give me the answer, but rather point me in the right direction. I looked through all my books to no avail and my tutor is taking too long to reply to my e-mail.
There is an Employee Class, which has three instant variables of type String: first name, second name, and emplyoeeNumber and an instant variable of type int called sales.
I have to create a new class called Payroll and declare a private instant variable called employeeSet which is capable of referencing Employee objects that are to be held in alphanumeric order of their employee numbers, and make it so that employeeSet is assigned a suitable empty set object when a new instance of Payroll is created
I then have to write a public instance method in the PayRoll class called enrollEmployee() which takes a string representation of an employee number as its argument and returns no value. The method should create an instance of Employee and then add it to the set referenced by the instance variable employeeSet.
All I got so far is this:
I just have no idea on what I am doing. I don't even know if the small amount I have done is right. I know it is simple, but I keep on over thinking things. Maybe it will make more sense if I have a rest, but haven't really got time to rest.