Created
January 17, 2018 18:32
-
-
Save memish/095399bcb5d235689cd381bc03b6ef14 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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