我正在编写一些扩展了另一个为编程任务开发的类的代码。但是我一直陷入与一个单一的错误,当我尝试编译我的程序:找不到符号错误
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