hi danpost
it has been a long while since I have post something in here , well here it is, have jus started this program as a practice and i used the super keyword to call the method in the account class . the firstname, lastname accnumber, and so on and now the super giving me this error in the savingsaccount class string, string int double has private acccess in account wat up with dah.
can someone explain this error. i did this already many and I have never get this error before. here is the codes
this is the account class [/cod
[code]this is the account class
ackage newpackage;
/**
*
* @author luanataylor
*/
public class Account {
private int accNum;
private String firstName;
private String lastName;
private double balance;
private Account(String fn, String ln, int an, double b){
firstName = fn;
lastName = ln;
accNum = an;
balance = b;
}
public int accNum(){
return accNum;
}
public String getfirstName(){
return firstName;
}
public String lastName(){
return lastName;
}
public double getbalance(){
return balance;
}
public void setaccNum(int accNum){
this.accNum = accNum;
}
public void setfirstName(String firstName){
this.firstName = firstName;
}
public void setlastName(String lastName){
this.lastName = lastName;
}
public void setbalance(double balance){
this.balance = balance;
}
public void setacctbal(double balance){
this.balance = balance;
}
@Override
public String toString(){
String getdetails = "first name "+firstName+ " "+ " last name "+ lastName+
" "+" account number "+ accNum+ " "+"balance "+ balance;
return getdetails;
}
}
this is the savingsaccount class
package newpackage;
/**
*
* @author luanataylor
*/
public class SavingsAccount extends Account {
private final double interestRate;
public SavingsAccount(String fn, String ln, int an, double b, double ir){
super(fn,ln,an,b);
interestRate=ir;
}
public void payinterestRate(){
double newbalance = super.getbalance();
newbalance = newbalance + (newbalance * interestRate);
super.setacctbal(newbalance);
}
