public class SuperTest03 {
public static void main(String[] args) {
CreditAccount ca1 = new CreditAccount();
System.out.println(ca1.getActno() + "," + ca1.getBanlance() + "," + ca1.getCredit());
CreditAccount ca2 = new CreditAccount("1111",10000.0,0.09);
System.out.println(ca2.getActno() + "," + ca2.getBanlance() + "," + ca2.getCredit());
}
}
class Account{
private String actno;
private double banlance;
public Account() {
}
public Account(String actno,double banlance) {
this.actno = actno;
this.banlance = banlance;
}
public void setActno(String actno) {
this.actno = actno;
}
public String getActno() {
return actno;
}
public void setBanlance(double banlance) {
this.banlance = banlance;
}
public double getBanlance() {
return banlance;
}
}
class CreditAccount extends Account{
private double credit;
public CreditAccount() {
}
public CreditAccount(String actno,double banlance,double credit) {
super(actno,banlance);
this.credit = credit;
}
public void setCredit(double credit) {
this.credit = credit;
}
public double getCredit() {
return credit;
}
}