?? account_tangqb.java
字號:
package com.jk.thread;
public class Account_tangqb {
private double balance;
public synchronized void withdraw(double price){
while(this.balance<price){
try {
wait();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
this.balance -= price;
System.out.println("Girl consume " + price + "and account has " + balance);
}
public synchronized void deposit(double earn){
notifyAll();
this.balance += earn;
System.out.println("Boy earn " + earn + " and account has " + balance);
}
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -