/**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);
}
}
转载于:https://blog.51cto.com/anglecode/1619895