/**11
* 編寫一個求平均值的接口與實現該接口的類
**/
public class Test{ public static void main(String[] args){ } } interface Average { double DoubleNumber(double a, double b); } class AverageDouble implements Average{ private double a, b; public double DoubleNumber(double a, double b){ this.a = a; this.b = b; return ((a * b) / 2); } }
时间: 2024-12-19 18:40:35