2条回答 默认 最新
- CSDN专家-sinJack 2022-12-26 13:57关注
根据题目意思定义Account类
public class Account { private String id; private String password; private String name; private double money; public Account(String id, String name, String password, double money) { this.id = id; this.password = password; this.name = name; this.money = money; } public void showInfo(){ System.out.println("账号:"+id+"\n姓名:"+name+"\n金额:"+money); } public double getInterest(){ return money*0.25/100; } }
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报