Skip to content
Advertisement

Getters and setters not working as it should

I need help im working on an assignment and getters and setters are not working. so im using an action listener when add amount is clicked it should add the amount that was entered to deposit amount and it does that but when i call getSavingBalance(); the balance still remains at zero. not that familiar with stack over flow couldnt post my entire code because they say i need to add more details so i just left whats of most importance.

JavaScript

Advertisement

Answer

In your action listener, savingBalance is not updated when you deposit. You should update savingBalance when you call setDeposit.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement