Java - Object-Oriented Programming Concepts
You want to convert this procedural code into OOP style:
Which is the best OOP approach?
int balance = 1000;
void deposit(int amount) {
balance += amount;
}
deposit(500);
System.out.println(balance);Which is the best OOP approach?
