Ben_T
❔ Accessing variable from another class
I have a Customer class that has a public Balance variable and it gets properly set within the class as I use it to update labels
When using a different class called MoneyOrder, the user inputs an amount and I try to access that balance to see if the amount is less than the balance. The issue is the balance is returning as 0.
I believe this is because I'm creating a new instance of the Customer class and so the Balance variable is being set to 0. I'm not too sure how to fix this as I've tried some other solutions but haven't gotten anywhere as the balance is always 0 or it causes other parts of the MoneyOrder class to not run so it'd more work just to even test
Would love some help on this!
21 replies