Account Example
This is an example of synchronized methods :
public class Account {
private double balance;
public Acount(double initialDeposit) {
balance = initialDeposit;
}
public synchronized double getBalance() {
return balance;
}
public synchronized void deposit(double amount) {
balance += amount;
}
}
Previous slide
Next slide
Back to first slide
View graphic version