You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calculator calculator = new BasicCalculator();
int sum = calculator.add(1, 2);
BasicCalculator cal = new BasicCalculator();
int difference = cal.subtract(3, 2);
Oh no! Users of the API are not coding to Calculator interface -- instead, they are coding to its implementation. Your API didn't enforce users to code to interfaces, as the BasicCalculator class was public.
But I don't know why you say "Oh no". Can you explain more?
Regards,
Huka.
The text was updated successfully, but these errors were encountered:
Hi,
At https://github.com/shekhargulati/java8-the-missing-tutorial/blob/master/01-default-static-interface-methods.md, I saw:
But I don't know why you say "Oh no". Can you explain more?
Regards,
Huka.
The text was updated successfully, but these errors were encountered: