Created
April 21, 2013 06:44
-
-
Save bbody/5428717 to your computer and use it in GitHub Desktop.
Simple Integer Calculator class (Division deliberately wrong)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Calculator{ | |
private int a, b; | |
public Calculator(int a, int b){ | |
this.a = a; | |
this.b = b; | |
} | |
public int addition(){ | |
return this.a + this.b; | |
} | |
public int subtraction(){ | |
return this.a - this.b; | |
} | |
public int multiplication(){ | |
return this.a * this.b; | |
} | |
public int division(){ | |
return (int)(this.a / this.b); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment