June 2018
Beginner
722 pages
18h 47m
English
Each of the classes that implement the Calculator interface may have static methods in addition to the instance methods defined in the interface. If such static methods could be helpful to the API's users, we should be able to document them in the Calculator interface, too, and that is what we are going to do now.
Let's assume that each of the implementations of the Calculator interface has a static method, addOneAndConvertToString():
public class CalculatorImpl implements Calculator { public static String addOneAndConvertToString(double d){ System.out.println(CalculatorImpl.class.getName()); return Double.toString(d + 1); } //...}public class AnotherCalculatorImpl implements Calculator { public static String ...
Read now
Unlock full access