java - Cannot find symbol error -


i writing code extends class developed programming assignment. keep getting stuck 1 single error when try compile program:

cdaccount.java:11: cannot find symbol symbol  : constructor bankaccount() location: class bankaccount         {         ^ 

and program follows:

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 positive balance amount");                     }                     else                     {                             if(rate < 0)                             {                                     throw new illegalargumentexception("please enter positive interest rate");                             }                             else                             {                                     if(penalty < 0)                                     {                                             throw new illegalargumentexception("please enter positive penalty amount");                                     }                                     else                                     {                                             if(owner.equals(null))                                             {                                                     throw new illegalargumentexception("please define person");                                             }                                             else                                             {                                                     owner_ = owner;                                                     balance_ = balance;                                                     rate_ = rate;                                                     penalty_ = penalty;                                             }                                     }                             }                     }             }     } 

your cdaccount constructor neesd call super class constructor it's first statement. if don't explicitly put

super(); 

as first line, compiler insert

super(); 

for (invisibly).

however backaccount class apparently doesn't have constructor takes no parameters, either add constructor does, or explicitly add call super class parameters have constructor like

super(owner); 

or whatever want pass super class.


Comments