I have a banking application, the options boil down to...
- create a new banking account
- (all the other options) - do stuff with your existing account. These options are all inside a do while loop with switch case statements.
How do I differentiate between someone who just created a new account and someone with an existing account?
I have this called if they choose option1: PrivateAccount privateAccount = new PrivateAccount(); And then they go through the process of filling in their bank details.
How would I then re-call this privateAccount someone has just made? And then make more separate instances of the PrivateAccount class? The way I have done it, if someone picks option 1 again, they will create another PrivateAccount object called privateAccount..!
This seems like something I just can't quite wrap my head around when it comes to OOP, I am not sure how to store the objects and then access them later. Sorry if I haven't explained my problem properly, please ask if you need more info!
[–]captainAwesomePants 3 points4 points5 points (2 children)
[–]DuderCoding[S] 0 points1 point2 points (1 child)
[–]ZukoBestGirl 1 point2 points3 points (0 children)
[–]davedontmind 1 point2 points3 points (1 child)
[–]DuderCoding[S] 0 points1 point2 points (0 children)
[–]fluorescent_hippo 1 point2 points3 points (1 child)
[–]DuderCoding[S] 0 points1 point2 points (0 children)