Skip to content

Instantly share code, notes, and snippets.

@memish
Created January 17, 2018 18:32
Show Gist options
  • Save memish/095399bcb5d235689cd381bc03b6ef14 to your computer and use it in GitHub Desktop.
Save memish/095399bcb5d235689cd381bc03b6ef14 to your computer and use it in GitHub Desktop.
public class Multiply
{
private int a;
private int b;
public Multiply(int a, int b)
{
this.a = a;
this.b = b;
}
public int times (){
return a * b;
}
public String toString()
{
return "" + a * b;
}
public boolean equals(Object o) {
Multiply m = (Multiply)o;
if(m.times()==(a*b))
return true;
else
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment