package com.apress.springrecipes.calculator;public class MaxCalculatorImpl implements MaxCalculator {    public double max(double a, double b) {        double result = (a >=b) ? a : b;        System.out.println("max(" + a + ", " + b + ") = " + result);        return result;    }}package com.apress.springrecipes.calculator;public class MinCalculatorImpl implements MinCalculator {    public double min(double a, double b) {        double result = (a <= b) ? a : b;        System.out.println("min(" + a + ", " + b + ") = " + result);        return result;    }}

Now, suppose you would like ArithmeticCalculatorImpl to perform the max() and min() calculation also. As the Java language supports single inheritance only, it is not possible for the ArithmeticCalculatorImpl ...

Get Spring Recipes: A Problem-Solution Approach, Third Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.