我正在編寫一些擴展了另一個爲編程任務開發的類的代碼。但是我一直陷入與一個單一的錯誤,當我嘗試編譯我的程序:找不到符號錯誤
CDAccount.java:11: cannot find symbol
symbol : constructor BankAccount()
location: class BankAccount
{
^
而且程序如下:
import java.lang.IllegalArgumentException;
public class CDAccount extends BankAccount
{
Person owner_;
double balance_;
double rate_;
double penalty_;
public CDAccount(Person Owner, double Balance, double Rate, double Penalty)
{
if(Balance < 0)
{
throw new IllegalArgumentException("Please enter a positive Balance amount");
}
else
{
if(Rate < 0)
{
throw new IllegalArgumentException("Please enter a positive Interest Rate");
}
else
{
if(Penalty < 0)
{
throw new IllegalArgumentException("Please enter a positive Penalty amount");
}
else
{
if(Owner.equals(null))
{
throw new IllegalArgumentException("Please define the Person");
}
else
{
owner_ = Owner;
balance_ = Balance;
rate_ = Rate;
penalty_ = Penalty;
}
}
}
}
}
}
請張貼您的BankAccount類。 – Esse 2011-04-29 04:09:49