public class TestRationalClass {
  /** Metoda main */
  public static void main(String[] args) {
    // Tworzenie i inicjowanie dwóch liczb wymiernych r1 i r2
    Rational r1 = new Rational(4, 2);
    Rational r2 = new Rational(2, 3);

    // Wyświetlanie wyników
    System.out.println(r1 + " + " + r2 + " = " + r1.add(r2));
    System.out.println(r1 + " - " + r2 + " = " + r1.subtract(r2));
    System.out.println(r1 + " * " + r2 + " = " + r1.multiply(r2));
    System.out.println(r1 + " / " + r2 + " = " + r1.divide(r2));
    System.out.println(r2 + " równa się " + r2.doubleValue());
  }
}
