fix method name.
| @@ -8,7 +8,7 @@ | ||
| 8 | 8 | * |
| 9 | 9 | */ |
| 10 | 10 | public class Tips { |
| 11 | - public static int Gcd(int n1,int n2) | |
| 11 | + public static int gcd(int n1,int n2) | |
| 12 | 12 | { |
| 13 | 13 | int m=Math.max(Math.abs(n1), Math.abs(n2)); |
| 14 | 14 | int n=Math.min(Math.abs(n1), Math.abs(n2)); |
| @@ -18,6 +18,6 @@ | ||
| 18 | 18 | if(l==0) |
| 19 | 19 | return n; |
| 20 | 20 | else |
| 21 | - return Tips.Gcd(l, n); | |
| 21 | + return Tips.gcd(l, n); | |
| 22 | 22 | } |
| 23 | 23 | } |
| @@ -43,16 +43,14 @@ | ||
| 43 | 43 | return new Frac(f1.getNumerator()*f2.getDenominator(),f1.getDenominator()*f2.getNumerator()); |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | - public int getNumerator(){return this.numerator;} | |
| 47 | - public int getDenominator(){return this.denominator;} | |
| 46 | + private int getNumerator(){return this.numerator;} | |
| 47 | + private int getDenominator(){return this.denominator;} | |
| 48 | 48 | |
| 49 | - public Frac getFrac(){return this;} | |
| 50 | - | |
| 51 | 49 | public void printFrac(){System.out.println(this.numerator+"/"+this.denominator);} |
| 52 | 50 | |
| 53 | 51 | private void reduction() |
| 54 | 52 | { |
| 55 | - int g = Tips.Gcd(this.numerator, this.denominator); | |
| 53 | + int g = Tips.gcd(this.numerator, this.denominator); | |
| 56 | 54 | try |
| 57 | 55 | { |
| 58 | 56 | this.numerator=this.numerator*(this.denominator/Math.abs(this.denominator))/g; |