Difference in output from use of synchronized keyword and join()
- by user2964080
I have 2 classes,
public class Account {
private int balance = 50;
public int getBalance() {
return balance;
}
public void withdraw(int amt){
this.balance -= amt;
} }
and
public class DangerousAccount implements Runnable{
private Account acct = new Account();
public static void main(String[] args) throws InterruptedException{
…