interface Taxable { final double taxRate = 0.06 ; double calculateTax() ; }
taxRate
is a constant. It must be set to a value.
Here is a partial definition of Toy
.
Recall that it:
Goods
.minimumAge
.class Toy extends Goods { protected int minimumAge; public Toy( String des, double pr, int min) { super( des, pr ); minimumAge = min ; } public String toString() { return super.toString() + "minimum age: " + minimumAge ); } public double // implement a method in the interface { return price * ; } }