
Siva J. answered 09/25/21
Experienced in developing DBMS (MySQL, SQLite) applications
// This requires some basic understanding of the interfaces and
// how the classes implementing the interfaces are required to provide the implementations.
// For example, here is the answer to your question.
interface CustomCalculation {
public int square(int x);
}
class ExecutorC implements CustomCalculation {
public int square(int x) {
int area = x * x;
return area;
}
}
public class Wyzant {
public static void main(String[] args) {
ExecutorC ec = new ExecutorC();
int area = ec.square(10);
System.out.println("Area " + area);
int area2 = ec.square(25);
System.out.println("Area " + area2);
}
}