ABMICalculatorWithInterface.java |
package lectures.interfaces; import util.annotations.WebDocuments; @WebDocuments({"Lectures/Interfaces.pptx", "Lectures/Interfaces.pdf", "Videos/Interfaces.avi"}) public class ABMICalculatorWithInterface implements BMICalculator{ public double calculateBMI(double height, double weight) { return weight/(height*height); } public static void main (String[] args) { BMICalculator[] bmiCalculators = {new ABMISpreadsheetAndCalculator(), new ABMICalculatorWithInterface()}; } }