title: please explain how to implement main method in my code?
body: <p>Please explain how to implement main method. i am having trouble with the main method and the line after main method, why the line after main method showing illegal start of expression?? is it because i forgot to put bracket somewhere or my code is wrong?? the code is suppose to perform arithmetic with fraction.</p>
  
  <p>public class Rational{</p>
  
  <pre><code>public static void main(String [] args){
      public int numerator;
      public int denominator;
  
  public Rational(int numerator, int denominator)
  
  {
      this.numerator = numerator;
      this.denominator = denominator;
      reduce();
  }
  
  public Rational add(Rational other)
  {
      int num = numerator * other.denominator + other.numerator * denominator;
      int den = denominator * other.denominator;
      return new Rational(num, den);
  }
  
  public Rational subtract(Rational other)
  {
      int num = numerator * other.denominator - other.numerator * denominator;
      int den = denominator * other.denominator;
      return new Rational(num, den);
  }
  
  public Rational multiply(Rational other)
  {
      int num = numerator * other.numerator;
      int den = denominator * other.denominator;
      return new Rational(num, den);
  }
  
  public Rational divide(Rational other)
  {
      int num = numerator * other.denominator;
      int den = denominator * other.numerator;
      return new Rational(num, den);
  }
  
  private void reduce()
  {
      int min = 0;
      if(numerator &gt; denominator)
      {
          min = denominator;
      }
      else
      {
          min = numerator;
      }
  
      for(int i = min; i &gt; 1; i--)
      {
          boolean isNumDiv = numerator % i == 0;
          boolean isDenDiv = denominator % i == 0;
  
          if(isNumDiv &amp;&amp; isDenDiv)
          {
              numerator = numerator / i;
              denominator = denominator / i;
              break;
          }
      }
  }
  
  public String toString()
  {
      return numerator + " / " + denominator;
  }
  </code></pre>
  
  <p>} }</p>