Banking operations in a procedural flow
Day 1 · Java fundamentals
A console menu handles interaction and calls operations that change a static balance. The input flow also rejects invalid amounts and withdrawals above the balance.
Selected project / 01
A paused Java learning track documenting three practical steps: from procedural banking operations to encapsulated objects, inheritance and method overriding.
Project scope
Overview
The repository organizes progressive Java exercises. Its history and files show three completed steps: basic operations, encapsulation, and an initial inheritance relationship. It is an ongoing study, not a finished application.
The project is currently paused while I focus on other learning priorities.
Learning progression
Day 1 · Java fundamentals
A console menu handles interaction and calls operations that change a static balance. The input flow also rejects invalid amounts and withdrawals above the balance.
Day 2 · encapsulation
BankAccount is created with an initial balance; the balance is private, and deposit and withdrawal validate their rules inside the object's methods.
Day 3 · inheritance and overriding
User validates names and email, generates a UUID and defines getRole(). Admin extends User and overrides that method; Main uses a User reference for both User and Admin instances.
Code evolution
These excerpts come from the exercises in the first three days. They show concrete changes in the code without implying an application architecture the repository does not yet have.
private static double balance = 1000.0;
public static double deposit(double value) {
balance += value;
return balance;
}private double balance;
public void deposit(double amount) {
if (amount <= 0) {
throw new IllegalArgumentException(
"The amount must be greater than 0."
);
}
balance += amount;
}public class Admin extends User {
public Admin(String name, String email) {
super(name, email);
}
@Override
public String getRole() {
return "Admin";
}
}Main also assigns an Admin instance to a User-typed variable; calling getRole() uses Admin's overridden implementation.
Practiced concepts
Learning
The progression helped me see where state and rules belong: first in operations concentrated in the program flow, then in an object that protects its own state, and finally in a specialized class that changes inherited behavior.