So, as a disclaimer, I'm extremely new to programming and probably don't see anything obvious. Now I am trying to create two methods with the name () and deposit () that will allow me to change the value of the currentBalance field, however every time I try to change the value of currentBalance using my two methods, I check the value of the field with my getBalance () method, and it always remains unchanged.
class TradingService{ public class Trader {
I am using DrJava and I am testing my code in the interaction panel. Here is the result of my tests.
> Trader t1 > t1 = new Trader("Bill") Trader@22e1cbe4 > t1.deposit(10.0) 10.0 > t1.getBalance() 0.0
I did everything I can imagine to fix the code, but I have no ideas, and I donβt think that writing random things in my code for 3 hours will do a lot.
Thanks for taking the time to read my question.
source share