Skip to content

Instantly share code, notes, and snippets.

@bbody
Created April 21, 2013 06:44
Show Gist options
  • Save bbody/5428717 to your computer and use it in GitHub Desktop.
Save bbody/5428717 to your computer and use it in GitHub Desktop.
Simple Integer Calculator class (Division deliberately wrong)
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