Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created December 20, 2021 18:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codecademydev/9a8c0f6f0886f91ed00d0420dba9d8c7 to your computer and use it in GitHub Desktop.
Save codecademydev/9a8c0f6f0886f91ed00d0420dba9d8c7 to your computer and use it in GitHub Desktop.
Codecademy export
public class Calculator() {
public Calculator() {
}
public int add(int a, int b) {
return a + b;
}
public int subtract(int a, int b) {
return a - b;
}
public int divide(int a, int b) {
return a / b;
}
public int multiply(int a, int b) {
return a * b;
}
public int modulo(int a, int b) {
return a % b;
}
public static void main(String[] args) {
Calculator myCalculator = new Calculator();
System.out.println(myCalculator.add(5, 7));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment