Practical Applications
## Bringing Java to Life
Imagine you want to track your savings and withdrawals. A banking app is a fantastic project to practice your Java skills!
### Requirements
- Store account holder information (name, balance).
- Allow deposits and withdrawals.
- Show the balance.
### Sample Code
```java
public class BankAccount {
String name;
double balance;
void deposit(double amount) {
balance += amount;
}
void withdraw(double amount) {
if (balance >= amount) {
balance -= amount;
}
}
void displayBalance() {
System.out.println("Balance: $" + balance);
}
}
```
## Real-World Impact
These skills are used in apps that manage money, track expenses, and even in ATMs!
Examples
- Creating a `BankAccount` class with deposit and withdraw methods.
- Simulating transactions and displaying updated balances.