package doay1; import java.util.Scanner; class Account1{ String id; String id2; double balance; double balance2; public void save(double money){ if(money > 0){ balance += money; }else{ System.out.println("参数有误"); } if(money > 0){ balance2 += money; }else{ System.out.println("参数有误"); } } public void withdraw(double money){ if(money <0){ System.out.println("参数有误"); }else if(money > balance){ System.out.println("余额不足"); }else{ balance -= money; } if(money <0){ System.out.println("参数有误"); }else if(money > balance2){ System.out.println("余额不足"); }else{ balance2 -= money; } } } class Customer1{ String name; String tel; String ci
Java 银行转账
最新推荐文章于 2024-05-11 14:53:44 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)