We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 693063c commit e8a43f0Copy full SHA for e8a43f0
Calculator.java
@@ -0,0 +1,9 @@
1
+public class Calculator {
2
+ public int add(int a, int b) { return a + b; }
3
+ public int subtract(int a, int b) { return a - b; }
4
+ public int multiply(int a, int b) { return a * b; }
5
+ public int divide(int a, int b) {
6
+ if (b == 0) throw new IllegalArgumentException("Cannot divide by zero");
7
+ return a / b;
8
+ }
9
+}
0 commit comments