public class Account
{
static int accountNum;
static int nextAccountNum = 112200;
static double balance;
public static void main(String args[])
{
Account checkingAccount = new Account(1500.00);
Account savingAccount = new Account(1000.00);
Account moneyMarketAccount = new Account(500.00);
checkingAccount.getAccountNumber();
savingAccount.getAccountNumber();
moneyMarketAccount.getAccountNumber();
}
public Account(double bal)
{
balance = bal;
accountNum = nextAccountNum;
nextAccountNum++;
}
}
每次運行它時,我都不會收到任何返回變量。我看到的只是過程完成的文本。尋找幫助無法返回變量java
什麼是你期待得到什麼?打印輸出? – Keppil 2013-05-08 22:14:29