Interface usage
Java
Easy
4 views
Problem Description
Task: create interface Computation and a class Add that implements it.
Output Format
Return value
Constraints
Use single method compute(a,b).
Official Solution
static interface Computation{int compute(int a,int b);}static class Add implements Computation{public int compute(int a,int b){return a+b;}}
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!