首页 > 信息互动 > > 正文
2023-12-16 23:48:10

accountnameoremail翻译(accountname)

导读 大家好,我是小夏,我来为大家解答以上问题。accountnameoremail翻译,accountname很多人还不知道,现在让我们一起来看看吧!1、public cl...

大家好,我是小夏,我来为大家解答以上问题。accountnameoremail翻译,accountname很多人还不知道,现在让我们一起来看看吧!

1、public class Account { private String accountName; private double amount; public Account() { accountName = "anonymous"; amount = 0; } public String getAccountName() { return accountName; } public double getAmount() { return amount; } public Account(String accountName, double amount) { this.accountName = accountName; this.amount = amount; } public void deposit(double money) { amount = money; } public int withdraw(double money) { if(amount >= money) { amount -= money; return 1; } else { return 0; } } }。

本文到此讲解完毕了,希望对大家有帮助。