From ce0861233b6b2c4f829c9803e27bdaa939f51583 Mon Sep 17 00:00:00 2001 From: Ramtin_Jafari Date: Sun, 26 Apr 2026 18:57:47 +0330 Subject: [PATCH] modify division instance method error message --- src/main/java/Rational/Rational.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/Rational/Rational.java b/src/main/java/Rational/Rational.java index b032afb..fc6fa5a 100644 --- a/src/main/java/Rational/Rational.java +++ b/src/main/java/Rational/Rational.java @@ -86,7 +86,7 @@ public class Rational { // COMPLETED - Instance method - this / other public Rational divide(Rational other) { if (other.numerator == 0) { - throw new ArithmeticException("Invalid division. Denominator will be zero"); + throw new ArithmeticException("Caught division by zero"); } int newNumerator = this.numerator * other.denominator;