package Task1;publicclassBank{privateint sum;publicvoidadd(int num){synchronized(this){
sum = sum+num;
System.out.println("账户的余额为:"+sum);}}}
package Task1;publicclassCustomerimplementsRunnable{private Bank b =newBank();@Overridepublicvoidrun(){// TODO Auto-generated method stubfor(int i=0;i<3;i++){
b.add(100);}}}
package Task1;public class Bank { private int sum; public void add(int num) { synchronized (this) { sum = sum+num; System.out.println("账户的余额为:"+sum); } }}package Task1;public class Customer implements Runnable { private Bank b =ne