Kitten 4 Him
First of all ... never EVER capitalize the first letter of a value. You only capitalize the name of a class. (Bonus should be bonus)
2nd - the way you have assigned your salary, bonus, and name are backwards in your Employee class. It should be:
public void setName(String name){
name = this.name;
}
The same goes for addBonus (when it's completed) and setSalary. Assignment goes from right to left.
For example:
int i;
i = 30;
i is now 30. It doesn't work if you have
30 = i;
The assignment is probably your main issue. Make a back-up copy of your work and try that.
smile
EDIT: Is your compiler not throwing up any errors??? Check those as well. They are good indicators as to where to look.
I'm pretty sure you've got that backwards. This code is correct.
public void setName(String name) {
this.name = name;
}
This code is incorrect (and would accomplish absolutely nothing).
public void setName(String name) {
name = this.name;
}
this.name <-- is the 'name' property of the current instance of the object.
name <-- is the value being passed into the method.
name = this.name; <-- This would set the 'name' parameter to the value of the the current instance's 'name' property. When the function exits, 'name' is popped off the stack and the change is lost anyways.
this.name = name; <-- This would set the current instance's 'name' property to the value just passed into the function (which is probably what he wanted to do).
Edit:
@TheAlmightyBeanDip: can you post your current source on Pastebin plz?