Java 9可以在接口内包含私有方法。
interface MyInter{ /* 来自 N o w J a v a . c o m - 时代Java*/ public default double a(double length, double width, double depth){ return myMethod(length, width, depth); } public default double b(double length, double width,double shallowDepth, double middleDepth, double deepDepth){ return myMethod(length, width, 6); } /** * Standard square or rectangular volume calculation. */ static double myMethod(