I would like to know why in Java I can do this
interface Specification{
double Interest =12.5;
void deposit(double);
}
class Base{
private String Account;
public Base(String acct){Account=acct;}
public void Show(){System.out.print("Account # "+Account);}
}
class Child extends Base implements Specification{
public Child (String acct){super(acct);Show();}
public void deposit(double cash){System.out.print("Now you have "+cash+" Dollars");}
}
but I can't do this
class Child implements Specification extends Base{
public Child (String acct){super(acct);Show();}
public void deposit(double cash){System.out.print("Now you have "+cash+" Dollars");}
}
Is there any specific order in Java or rule when using extends
and implements
in the same class.
I would like somebody to explain me the reasons please.