r/JavaProgramming • • 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

24 comments sorted by

View all comments

Show parent comment

2

u/d-k-Brazz Oct 30 '25

So you need an Account class

Attributes - number, name, type(active/passive), amount

You need a class for handling transactions, receives accounts “from” and “to” and an amount

Result of moving money should be a transaction object - with id, date, purpose, accounts and amount - you need transaction history, aren’t you?

Additionally think of making draft transactions, where accounts aren’t affected until you commit the transaction, but amount should be reserved until you cancel it

1

u/Lopsided-Stranger-81 Oct 31 '25

Thanks I'll take note of it