โ Back to Interfaces
Question 598
Interface Method With Parameters
Interface Method With Parameters
The interfaceICalculatordeclaresint Add(int a, int b). Complete theCalculatorclass soAddreturns the sum of its two parameters. Do NOT write aMainmethod. ForAdd(2, 3)the program prints: 5
Expected Output:
5
Topics:
Interfaces
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (cw, cr, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.