public static void main(String[] args) { FruitSeller seller = new FruitSeller(); FruitBuyer buyer = new FruitBuyer(); buyer.buyApple(seller, 2000); ; // seller에게 2000원어치 사과 구매 System.out.println("과일 판매자의 현재 상황"); seller.ShowSaleResult(); System.out.println("과일 구매자의 현재 상황"); buyer.showBuyResult(); }
public void buyApple(FruitSeller seller, int money) { numOfApple += seller.saleApple(money); myMoney -= money; }