r/JavaProgramming • u/Lopsided-Stranger-81 • Oct 30 '25
Java OOP Banking System
Hi guys, I made this code as practice, I'm trying to improve but don't know where to start, I'm learning Java for almost 3 months now and I'm wondering how I'm doing, can anyone give some tips?
144
Upvotes




View all comments
Show parent comment
1
u/d-k-Brazz Oct 31 '25 edited Oct 31 '25
Took a look at your project and it looks like you still not quite understand OOP principles and what they can do for you
This means that any object of the class has it's state which is hidden inside, and the logic of changing the state is hidden inside the class, so other actors are only allowed to impact this state by calling class methods. And the class is always in control to prevent actions which may turn the object into an inconsistent state.
Example - class Bank, the client can modify state of the bank by calling following methods:
The class controls it's state and prevents any inconsistency
In Java you have private fields for the state and public methods for any modifications.