Skip to Content
Spring Recipes: A Problem-Solution Approach, Third Edition
book

Spring Recipes: A Problem-Solution Approach, Third Edition

by Marten Deinum, Josh Long, Gary Mak, Daniel Rubio
November 2014
Intermediate to advanced content levelIntermediate to advanced
808 pages
22h 47m
English
Apress
Content preview from Spring Recipes: A Problem-Solution Approach, Third Edition
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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Spring 5 Recipes: A Problem-Solution Approach

Spring 5 Recipes: A Problem-Solution Approach

Marten Deinum, Daniel Rubio, Josh Long
Spring Recipes, Second Edition

Spring Recipes, Second Edition

Gary Mak, Josh Long, Daniel Rubio
SPRING COOKBOOK

SPRING COOKBOOK

Jerome Jaglale, Murat Yilmaz

Publisher Resources

ISBN: 9781430259091Purchase book